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 #define ON 1 00005 #define OFF 0 00006 00007 DigitalOut mled1(LED1); 00008 DigitalOut mled2(LED2); 00009 DigitalOut mled3(LED3); 00010 DigitalOut mled4(LED4); 00011 AnalogIn vin_adc(p20); 00012 AnalogIn vr_adc(p19); 00013 00014 TextLCD lcd(p24, p25, p26, p27, p28, p29, p30,16,2); // rs, rw, e, d0, d1, d2, d3 00015 float adc_volt; 00016 00017 int main() { 00018 while(1){ 00019 lcd.cls(); 00020 lcd.locate(0,0); 00021 lcd.printf("Vin:%2.1fV",vin_adc.read()*15); 00022 lcd.locate(0,1); 00023 lcd.printf("Vr:%2.1fV",vr_adc.read()*15); 00024 mled1=ON; 00025 wait(0.3); 00026 mled1=OFF; 00027 wait(0.3); 00028 }//while 00029 }//main
Generated on Sun Jul 24 2022 03:45:34 by
1.7.2