by Rob Toulson and Tim Wilmshurst from textbook "Fast and Effective Embedded Systems Design: Applying the ARM mbed"

Dependencies:   TextLCD mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 
00002 /*Program Example 8.7: Display analog input data
00003                                     */
00004 #include "mbed.h"
00005 #include "TextLCD.h" 
00006 TextLCD lcd(p19, p20, p21, p22, p23, p24); //rs,e,d0, d1,d2,d3
00007 AnalogIn Ain(p17);
00008 float percentage;
00009 
00010 int main() {
00011   while(1){
00012     percentage=Ain*100;
00013     lcd.printf("%1.2f",percentage);
00014     wait(0.002);
00015     lcd.cls();
00016   }
00017 }
00018