test file
Fork of TextLCD_HelloWorld by
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 // Hello World! for the TextLCD 00002 00003 #include "mbed.h" 00004 #include "TextLCD.h" 00005 00006 TextLCD lcd(p25, p26, p24, p23, p22, p21); // rs, e, d4-d7 00007 Serial pc(USBTX,USBRX); 00008 AnalogIn voltage(p15); 00009 int main() 00010 { 00011 while (1){ 00012 lcd.printf("Voltage in fraction: %2.4f\n", voltage.read()); 00013 pc.printf("Voltage in fraction: %2.4f\n", voltage.read()); 00014 00015 wait(5); 00016 lcd.printf("Voltage in integer: %6d\n", voltage.read_u16()); 00017 pc.printf("Voltage in integer: %6d\n", voltage.read_u16()); 00018 wait(5); 00019 } 00020 }
Generated on Sun Jul 24 2022 23:12:08 by
1.7.2
