proyectotecnicas / Mbed 2 deprecated CAS-to-LCD

Dependencies:   TextLCD mbed

Fork of LCD_test by proyectotecnicas

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(PTC2);
00006 
00007 TextLCD lcd(PTD3, PTA12, PTA4, PTA5, PTC8, PTC9, TextLCD::LCD16x2);
00008 
00009 int main() {
00010 
00011     float temperatura;
00012     float voltajecas;
00013     uint16_t adcvalue;
00014 
00015     while(1){
00016         lcd.cls();
00017         adcvalue = leer.read_u16();
00018         voltajecas = adcvalue*3.3/65525;
00019         lcd.printf("El Vcas es %.2f", voltajecas);
00020         temperatura = voltajecas * 100 / 5 + 0.04;
00021         lcd.locate(0,1);
00022         lcd.printf("Hace %.0f grados", temperatura);
00023         wait(1.5);
00024 
00025     
00026     
00027     }
00028 }