describe una lectura analogica basica

Dependencies:   TextLCD mbed

main.cpp

Committer:
tony63
Date:
2015-09-28
Revision:
2:7d8925e51f85
Parent:
1:d4b9822b8df4

File content as of revision 2:7d8925e51f85:

// ejemplo lectura analoga
// EJEMPLO CON UN LCD PARA EL MODULO FRDM-KL25Z PARA LECTURA ANALOGA
//y enviar al pc por puerto serial

#include "mbed.h"
#include "TextLCD.h"
Serial pc(USBTX,USBRX); //puertos del PC
AnalogIn Vin(PTC2);
TextLCD lcd(PTB10, PTB11, PTE2, PTE3, PTE4, PTE5); // rs, e, d4-d7

int main( ){
    
    lcd.cls();
    wait(0.1);
    while(1){
    lcd.cls();
    lcd.printf("Volt(%f)", Vin.read());
    pc.printf("%f\n", Vin.read()); 
    wait(0.1);
}
}