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: mbed
main.cpp
00001 #include "mbed.h" 00002 00003 Serial pc(USBTX, USBRX); 00004 DigitalOut led0(LED1), led25(LED2), led50(LED3), led75(LED4); 00005 00006 AnalogIn temt6000(p15); 00007 // temt6000 breakout: VCC(to VOUT=3.3V), GND(to GND), SIG(to p15) 00008 00009 int main() 00010 { 00011 for(;;) 00012 { 00013 float x = temt6000; 00014 00015 // four LEDs meaning "light level" (1 to 4): 00016 led0 = 1; 00017 led25 = led50 = led75 = 0; 00018 if(x>0.25) led25 = 1; 00019 if(x>0.50) led50 = 1; 00020 if(x>0.75) led75 = 1; 00021 00022 printf("%f\r\n", x); 00023 wait(0.50); 00024 } 00025 }
Generated on Sun Aug 7 2022 04:42:26 by
1.7.2