Hexiwear TSL2561 Thanks for Kenji Arai

Dependencies:   TSL2561

main.cpp

Committer:
i_am_kitsune
Date:
2018-02-20
Revision:
0:c9d717ad98fe

File content as of revision 0:c9d717ad98fe:

#include "mbed.h"
#include "TSL2561.h"
Serial      pc(USBTX, USBRX); // Serial interface
DigitalOut  sensorPowerEn(PTB12);
DigitalOut  led1(LED1);

TSL2561     lum(PTB1,PTB0);    // TSL2561 SDA, SCL
// main() runs in its own thread in the OS
int main() {
    
    sensorPowerEn = 0;
    pc.baud(115200);
    printf("who am i : %d \r\n", lum.who_am_i());

    while (true) {
        led1 = !led1;
        printf("Illuminance: %+7.2f [Lux]\r\n", lum.lux());
        wait(0.5);
        
    }
}