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.
Fork of mbed-os-example-mbed5-blinky by
main.cpp
00001 #include "mbed.h" 00002 00003 DigitalOut led1(LED1); 00004 //Edit input pin setup according to where hall sensor is connected 00005 //(USER_BUTTON0 for button on GR-PEACH) 00006 DigitalIn hall_sensor(USER_BUTTON0); 00007 Serial pc(USBTX, USBRX); 00008 00009 // main() runs in its own thread in the OS 00010 // (note the calls to Thread::wait below for delays) 00011 int main() { 00012 pc.printf("\n\r"); 00013 pc.printf("BD7411G Hall sensor example application.\r\n"); 00014 pc.printf("Led on board will change ON/OFF according to magnet detection. \n\r"); 00015 00016 while (true) { 00017 led1 = hall_sensor; 00018 Thread::wait(100); 00019 } 00020 } 00021
Generated on Sun Jul 17 2022 21:20:22 by
1.7.2

Rohm BD7411G | Magnet Hall IC