bernard rayappa / Mbed 2 deprecated lcdmonitor

Dependencies:   TextLCD mbed

Fork of TextLCD_HelloWorld by Srinivasan Ramasamy

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

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 }