Demo application of reading 6 different sensors and outputting values on UART. This demo can be used with Rohm tileshield using tiles for BH1726, BD1020, RPR0521, BH1745, ML8511 and BD7411. Developed and tested using Renesas GR-Peach -board.

Dependencies:   rohm-bh1726 rohm-bh1745 rohm-rpr0521 rohm-sensor-hal

Fork of rohm-bd7411g-hello by Rohm

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);
    }
}