by Rob Toulson and Tim Wilmshurst from textbook "Fast and Effective Embedded Systems Design: Applying the ARM mbed"
Diff: main.cpp
- Revision:
- 0:e2c8a8062bb5
diff -r 000000000000 -r e2c8a8062bb5 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri May 24 21:34:47 2013 +0000 @@ -0,0 +1,18 @@ + +/*Program Example 8.7: Display analog input data + */ +#include "mbed.h" +#include "TextLCD.h" +TextLCD lcd(p19, p20, p21, p22, p23, p24); //rs,e,d0, d1,d2,d3 +AnalogIn Ain(p17); +float percentage; + +int main() { + while(1){ + percentage=Ain*100; + lcd.printf("%1.2f",percentage); + wait(0.002); + lcd.cls(); + } +} +