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 sensors by
example.cpp
00001 #include "sensors.h" 00002 #include "mbed.h" 00003 00004 Serial usb2pc(PA_2, PA_3, 9600); 00005 DigitalOut myled(PC_13); 00006 00007 int main() 00008 { 00009 00010 00011 usb2pc.printf("starting\r\n"); 00012 sr501 x(PB_1); 00013 BH1750 y(PB_7,PB_6); 00014 00015 while(1) 00016 { 00017 /* 00018 if(x.operator ==(true)) 00019 { 00020 usb2pc.printf("get\r\n"); 00021 while(x.read()){usb2pc.printf("aaaaaaaaaaaaa\r\n");wait(0.1);myled=1;} 00022 x.reset(); 00023 } 00024 00025 else 00026 { 00027 usb2pc.printf("no\r\n"); 00028 } 00029 wait(0.1); 00030 */ 00031 00032 float light=y.getlightdata(); 00033 usb2pc.printf("Light intensity: %.4f Lux\r\n",light); 00034 } 00035 }
Generated on Wed Jul 13 2022 10:25:13 by
