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
Diff: main.cpp
- Revision:
- 12:18c2160813c6
- Parent:
- 8:bb09890333fe
- Child:
- 13:69b1b8cadb78
--- a/main.cpp Fri Sep 02 15:15:05 2016 +0100
+++ b/main.cpp Mon Sep 19 10:07:15 2016 +0000
@@ -1,13 +1,21 @@
#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 = !led1;
- Thread::wait(500);
+ led1 = hall_sensor;
+ Thread::wait(100);
}
}
