
Rohm BD7411g Omnipolar Detection Hall IC hello world.
Fork of mbed-os-example-mbed5-blinky by
main.cpp
- Committer:
- MikkoZ
- Date:
- 2016-09-19
- Revision:
- 12:18c2160813c6
- Parent:
- 8:bb09890333fe
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); } }