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: LinearAnalogSensors mbed
Fork of mbed_selectled by
main.cpp
00001 #include "mbed.h" 00002 00003 Serial pc(USBTX, USBRX); 00004 DigitalOut myled1(LED1), myled2(LED2); 00005 AnalogIn LM61(p15); 00006 00007 char program_name[128] = "Serial IO"; 00008 00009 int main() 00010 { 00011 pc.printf("run: %s\n", program_name); 00012 float temp, tempC, tempF; 00013 while(1) { 00014 temp = LM61; 00015 tempC = ((temp*3.3)-0.600)*100.0; 00016 //convert to degrees F 00017 tempF = (9.0*tempC)/5.0 + 32.0; 00018 //print current temp 00019 printf("%5.2F : %5.2F C %5.2F F \n\r", temp, tempC, tempF); 00020 wait(2); 00021 00022 } 00023 }
Generated on Fri Aug 12 2022 15:55:08 by
1.7.2
