Hexiwear TSL2561 Thanks for Kenji Arai
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 #include "mbed.h" 00002 #include "TSL2561.h" 00003 Serial pc(USBTX, USBRX); // Serial interface 00004 DigitalOut sensorPowerEn(PTB12); 00005 DigitalOut led1(LED1); 00006 00007 TSL2561 lum(PTB1,PTB0); // TSL2561 SDA, SCL 00008 // main() runs in its own thread in the OS 00009 int main() { 00010 00011 sensorPowerEn = 0; 00012 pc.baud(115200); 00013 printf("who am i : %d \r\n", lum.who_am_i()); 00014 00015 while (true) { 00016 led1 = !led1; 00017 printf("Illuminance: %+7.2f [Lux]\r\n", lum.lux()); 00018 wait(0.5); 00019 00020 } 00021 } 00022
Generated on Mon Jul 18 2022 19:16:47 by
1.7.2