Sudip Mandal / Mbed 2 deprecated SensorValueDisplay

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(p5,p6,p7,p8,p9,p10);
00005  AnalogIn ldr(p15);
00006  int main()
00007  {
00008     {lcd.cls();
00009     wait_ms(0.02);
00010     lcd.locate(0,0);
00011     lcd.printf("SENSOR OUTPUT VOLTAGE");}
00012     
00013 while(1)
00014 {int ldr_value=ldr;
00015   float voltage=ldr_value*(5.0/1023.0);
00016   lcd.locate(1,1);
00017   lcd.printf("%0.0f",voltage);
00018   lcd.printf("Volt");
00019   }
00020     
00021 }