Michael Pascual / Mbed 2 deprecated lcd

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "TextLCD.h"
00003 
00004 TextLCD lcd(p10, p12, p15, p16, p29, p30, TextLCD::LCD20x2); // rs, e, d0-d3
00005 AnalogIn ain(p20);
00006 
00007 
00008 int main() {
00009     //while(1) {
00010     lcd.cls();
00011     lcd.locate(7, 0);
00012     lcd.printf("Percent is");  
00013     lcd.locate(9, 1);
00014     lcd.printf("%.3f\n",100*ain.read());
00015 
00016     //lcd.printf("Percent is %.1f\n",100*ain.read());
00017     //lcd.printf("Voltage is %.3f\n",3.3*ain.read());
00018 }
00019 //}