Yoshihiro TSUBOI
/
app-board-pot
a test code that read pot value with AnalogIn and display that on LCD of mbed Application Shield
Diff: main.cpp
- Revision:
- 0:84f51e352a37
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Jan 22 10:11:17 2016 +0000 @@ -0,0 +1,19 @@ +#include "mbed.h" +#include "C12832.h" + +C12832 lcd(p5, p7, p6, p8, p11); + +AnalogIn pot1 (p19); +AnalogIn pot2 (p20); + +int main() +{ + while(1) { + lcd.cls(); + lcd.locate(0,3); + lcd.printf("Pot 1 = %.2f", (float)pot1); + lcd.locate(0,14); + lcd.printf("Pot 2 = %.2f", (float)pot2); + wait(0.1); + } +}