Hisyam Sulaiman / Mbed 2 deprecated ADC

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 
00004 TextLCD lcd(D8, D9, D4, D5, D6, D7);
00005 Serial pc(USBTX, USBRX);
00006 AnalogIn Ain(PC_3);
00007 float ADCdata;
00008 
00009 int main() {
00010     
00011 lcd.locate (1,0);   
00012 lcd.printf("Temp Measure");
00013 lcd.locate (0,1);   
00014 lcd.printf("Cel");
00015 lcd.locate (8,1);   
00016 lcd.printf("Fah");
00017         
00018     /*while(1) {
00019         ADCdata=Ain;
00020         ADCdata=ADCdata;
00021         lcd.locate (4,1);
00022         lcd.printf("%f",ADCdata);
00023         pc.printf("%f\n\r",ADCdata);
00024         lcd.locate (11,1);
00025         lcd.printf("%f",ADCdata);
00026         pc.printf("%f\n\r",ADCdata);
00027         wait(0.5);*/
00028     }
00029