Eduvance Remolab
/
Analog_LDR_and_LCD
This lab shows how to interface and analog input with a traditional 16x2 LCD
Revision 0:e95cb494c628, committed 2016-02-05
- Comitter:
- EduRemo
- Date:
- Fri Feb 05 07:26:37 2016 +0000
- Commit message:
- FRCRCE
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TextLCD.lib Fri Feb 05 07:26:37 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/simon/code/TextLCD/#308d188a2d3a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Feb 05 07:26:37 2016 +0000 @@ -0,0 +1,16 @@ +#include "mbed.h" +#include "TextLCD.h" + + +TextLCD lcd(PTC9, PTC8, PTA5, PTA4, PTA12, PTD4, TextLCD::LCD16x2); // rs, e, d4-d7 +AnalogIn ain(PTC2); + +int main(void){ + while(1){ + lcd.cls(); + lcd.locate(0,0); + lcd.printf("Winter is coming"); + lcd.locate(0,1); + lcd.printf("value is %.2f",ain.read()); + wait(1); + }}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Feb 05 07:26:37 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/9296ab0bfc11 \ No newline at end of file