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 #include "TextLCD.h" 00003 00004 AnalogIn LM35(p15); 00005 00006 TextLCD lcd(p21,p22,p23,p24,p25,p26); 00007 00008 int main() 00009 { 00010 float tempC,tempF,a[10],avg; 00011 int i; 00012 00013 while(1) 00014 { 00015 00016 avg=0; 00017 for(i=0;i<10;i++) 00018 { 00019 a[i]=LM35.read(); 00020 wait(.02); 00021 } 00022 for(i=0;i<10;i++) 00023 { 00024 avg=avg+(a[i]/10); 00025 } 00026 00027 00028 tempC=(avg*3.685503686*100); 00029 tempF=(9.0*tempC)/5.0 + 32.0; 00030 lcd.locate(0,0); 00031 lcd.printf(" Temperature "); 00032 lcd.locate(0,1); 00033 lcd.printf("%.2f C %.2f F",tempC,tempF); 00034 00035 wait(.5); 00036 } 00037 }
Generated on Tue Jul 12 2022 20:17:28 by
1.7.2