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.
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(p20); 00007 // temt6000 breakout: VCC(to VOUT=3.3V), GND(to GND), SIG(to p20) 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.25); 00024 } 00025 }
Generated on Tue Jul 12 2022 20:32:39 by
1.7.2