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 TextLCD lcd ( p26, p25, p24, p23, p22, p21 ) ; // rs, e, d4 d5, d6, d7 00004 AnalogIn Ain ( p17 ) ; 00005 int percentage ; 00006 float voltage; 00007 int main( ) 00008 { while(1) 00009 { percentage = Ain * 100 ; 00010 lcd.locate ( 1 , 0 ); 00011 lcd.printf("percentage:"); 00012 lcd.printf ("%i" , percentage) ; 00013 voltage= Ain*3.30-0.3; 00014 lcd.locate ( 1 , 1 ); 00015 lcd.printf("Voltage: "); 00016 lcd.printf ("%.1f" , voltage) ; 00017 lcd.printf(" V"); 00018 wait(0.02) ; 00019 lcd.cls( ) ; 00020 } 00021 }
Generated on Tue Jul 12 2022 15:38:46 by
1.7.2