Sudip Mandal
/
SensorValueDisplay
getting values from sensor and display those values on LCD
Diff: main.cpp
- Revision:
- 0:266105102052
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Nov 03 06:44:28 2016 +0000 @@ -0,0 +1,21 @@ +#include "mbed.h" +#include "TextLCD.h" + + TextLCD lcd(p5,p6,p7,p8,p9,p10); + AnalogIn ldr(p15); + int main() + { + {lcd.cls(); + wait_ms(0.02); + lcd.locate(0,0); + lcd.printf("SENSOR OUTPUT VOLTAGE");} + +while(1) +{int ldr_value=ldr; + float voltage=ldr_value*(5.0/1023.0); + lcd.locate(1,1); + lcd.printf("%0.0f",voltage); + lcd.printf("Volt"); + } + +}