lcd for beginners

Dependencies:   TextLCD mbed

Fork of TextLCD_HelloWorld by Srinivasan Ramasamy

Committer:
svk2602
Date:
Sun Jan 05 10:41:11 2014 +0000
Revision:
5:75457df5e558
Parent:
4:1ad7d56050dd
hello

Who changed what in which revision?

UserRevisionLine numberNew contents of line
simon 1:7418a52375a0 1 // Hello World! for the TextLCD
simon 1:7418a52375a0 2
simon 0:334327d1a416 3 #include "mbed.h"
simon 0:334327d1a416 4 #include "TextLCD.h"
simon 0:334327d1a416 5
ramsphd 4:1ad7d56050dd 6 TextLCD lcd(p25, p26, p24, p23, p22, p21); // rs, e, d4-d7
ramsphd 4:1ad7d56050dd 7 Serial pc(USBTX,USBRX);
ramsphd 4:1ad7d56050dd 8 AnalogIn voltage(p15);
ramsphd 3:bae19bde97d5 9 int main()
ramsphd 3:bae19bde97d5 10 {
ramsphd 3:bae19bde97d5 11 while (1){
svk2602 5:75457df5e558 12 lcd.printf("Voltage in fraction: %2.4f\n\r", voltage.read());//voltage is name
svk2602 5:75457df5e558 13 pc.printf("Voltage in fraction: %2.4f\n\r", voltage.read());
svk2602 5:75457df5e558 14 //lcd.printf("Voltage in fraction\n");
svk2602 5:75457df5e558 15 //lcd.printf("SVK\n");
ramsphd 4:1ad7d56050dd 16 wait(5);
svk2602 5:75457df5e558 17 lcd.printf("Voltage in integer: %6d\n\r", voltage.read_u16());
svk2602 5:75457df5e558 18 pc.printf("Voltage in integer: %6d\n\r", voltage.read_u16());
ramsphd 4:1ad7d56050dd 19 wait(5);
simon 0:334327d1a416 20 }
ramsphd 3:bae19bde97d5 21 }