Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: rohm-bh1726 rohm-bh1745 rohm-rpr0521 rohm-sensor-hal
Fork of rohm-bd7411g-hello by
main.cpp
- Committer:
- MikkoZ
- Date:
- 2016-09-19
- Revision:
- 12:18c2160813c6
- Parent:
- 8:bb09890333fe
- Child:
- 13:69b1b8cadb78
File content as of revision 12:18c2160813c6:
#include "mbed.h"
DigitalOut led1(LED1);
//Edit input pin setup according to where hall sensor is connected
//(USER_BUTTON0 for button on GR-PEACH)
DigitalIn hall_sensor(USER_BUTTON0);
Serial pc(USBTX, USBRX);
// main() runs in its own thread in the OS
// (note the calls to Thread::wait below for delays)
int main() {
pc.printf("\n\r");
pc.printf("BD7411G Hall sensor example application.\r\n");
pc.printf("Led on board will change ON/OFF according to magnet detection. \n\r");
while (true) {
led1 = hall_sensor;
Thread::wait(100);
}
}
