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 TextLCD lcd(D8, D9, D4, D5, D6, D7); 00005 DigitalIn button(PA_12); 00006 Serial pc(USBTX, USBRX); 00007 AnalogIn Ain(PC_3); 00008 float ADCdata; 00009 00010 int main() { 00011 00012 lcd.locate (1,0); 00013 lcd.printf("Celsius"); 00014 00015 00016 while(1) { 00017 if (button==0){ 00018 ADCdata=Ain; 00019 ADCdata=ADCdata*100; 00020 lcd.locate (4,1); 00021 lcd.printf("%f",ADCdata); 00022 pc.printf("%f\n\r",ADCdata); 00023 wait(0.5);} 00024 else (button==1){ 00025 ADCdata=Ain; 00026 ADCdata=ADCdata*100; 00027 lcd.locate (12,1); 00028 lcd.printf("%f",ADCdata); 00029 pc.printf("%f\n\r",ADCdata); 00030 wait(0.5);} 00031 } 00032 }
Generated on Fri Jul 15 2022 18:41:48 by
1.7.2