Envia valor ADC a Matlab y LCD

Dependencies:   TextLCD mbed

main.cpp

Committer:
franni
Date:
2017-04-27
Revision:
1:d52dfec70159
Parent:
0:31ba7713a4a0

File content as of revision 1:d52dfec70159:

#include "mbed.h"
#include "TextLCD.h" 

 
Serial rs232(USBTX, USBRX);
AnalogIn Ain(PTB0); 

float ADCdata;

TextLCD lcd(PTE20,PTE21,PTE22,PTE23,PTE29,PTE30, TextLCD::LCD16x2); // Rs, E, d4, d5, d6, d7 
 

int main()
{
    rs232.printf("ADC Data Values... \n\r");
    lcd.printf("ADC Data Values...\r\n");
    wait(1);
    lcd.cls();
    lcd.locate(0,0);
    

    while (1) {

        rs232.printf(" %f ",Ain.read()*5);
        lcd.locate(0,0);
        lcd.printf("Valor ADC: %f ",Ain.read()*5);
        wait(.1);

    }
}