Syahir Ammar Sazely / Mbed 2 deprecated ADCexercise

Dependencies:   TextLCD mbed

main.cpp

Committer:
syahirammar
Date:
2018-05-17
Revision:
0:a8782cd1474e

File content as of revision 0:a8782cd1474e:

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

TextLCD lcd(D8, D9, D4, D5, D6, D7);
Serial pc(USBTX, USBRX);
AnalogIn Ain(PC_3);
float ADCdata;

int main() {
lcd.printf("LDR =");
   while (1)
   {    
    ADCdata=Ain;
    ADCdata=ADCdata*100;
    lcd.locate (4,1);
    lcd.printf("%f",ADCdata);
    pc.printf("%f \n\r",ADCdata);
    wait (0.5);
   }   
}