a test code that read pot value with AnalogIn and display that on LCD of mbed Application Shield

Dependencies:   C12832 mbed

Committer:
ytsuboi
Date:
Fri Jan 22 10:11:17 2016 +0000
Revision:
0:84f51e352a37
first commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ytsuboi 0:84f51e352a37 1 #include "mbed.h"
ytsuboi 0:84f51e352a37 2 #include "C12832.h"
ytsuboi 0:84f51e352a37 3
ytsuboi 0:84f51e352a37 4 C12832 lcd(p5, p7, p6, p8, p11);
ytsuboi 0:84f51e352a37 5
ytsuboi 0:84f51e352a37 6 AnalogIn pot1 (p19);
ytsuboi 0:84f51e352a37 7 AnalogIn pot2 (p20);
ytsuboi 0:84f51e352a37 8
ytsuboi 0:84f51e352a37 9 int main()
ytsuboi 0:84f51e352a37 10 {
ytsuboi 0:84f51e352a37 11 while(1) {
ytsuboi 0:84f51e352a37 12 lcd.cls();
ytsuboi 0:84f51e352a37 13 lcd.locate(0,3);
ytsuboi 0:84f51e352a37 14 lcd.printf("Pot 1 = %.2f", (float)pot1);
ytsuboi 0:84f51e352a37 15 lcd.locate(0,14);
ytsuboi 0:84f51e352a37 16 lcd.printf("Pot 2 = %.2f", (float)pot2);
ytsuboi 0:84f51e352a37 17 wait(0.1);
ytsuboi 0:84f51e352a37 18 }
ytsuboi 0:84f51e352a37 19 }