Eduvance Remolab
/
Analog_LDR_and_LCD
This lab shows how to interface and analog input with a traditional 16x2 LCD
main.cpp
- Committer:
- EduRemo
- Date:
- 2016-02-05
- Revision:
- 0:e95cb494c628
File content as of revision 0:e95cb494c628:
#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); }}