proyectotecnicas / Mbed 2 deprecated LCD_test

Dependencies:   TextLCD 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 #include "AnalogIn.h"
00004 
00005 AnalogIn leer(PTC1);
00006 
00007 TextLCD lcd(PTE20, PTE21, PTE22, PTE23, PTB20, PTE30, TextLCD::LCD16x2);
00008 
00009 int main() {
00010 
00011 float lectura;
00012 float voltaje;
00013 
00014     while(1){
00015     
00016     lectura = leer.read();
00017     voltaje = lectura*3.3;
00018     lcd.cls();
00019     lcd.printf("%f",lectura);
00020     lcd.locate(1,1);
00021     lcd.printf("%f", voltaje);
00022     wait(2);
00023     
00024     
00025     }
00026 }