![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Homework#2 Problem#2
Fork of Bootcamp-fatal-error-pot by
Diff: main.cpp
- Revision:
- 1:b0f34fae61a5
- Parent:
- 0:455e8a85d3eb
- Child:
- 2:a808561b7b9b
--- a/main.cpp Mon Jun 24 05:49:35 2013 +0000 +++ b/main.cpp Thu Jun 27 07:13:41 2013 +0000 @@ -1,13 +1,23 @@ #include "mbed.h" +#include "C12832_lcd.h" DigitalIn button(p21); -AnalogIn pot(p20); +AnalogIn potA(p20); +AnalogIn potB(p19); +C12832_LCD lcd; int main() { - while(pot > 0.0) { - printf("Pot value = %f", pot.read()); + while(potA < 0.999 && potB < 0.999) { + lcd.cls(); + lcd.locate(0,3); + lcd.printf("Pot A,%d, %d\n", potA.read_u16(),potB.read_u16()); wait(0.1); } + lcd.cls(); + lcd.locate(10,3); + lcd.printf("Loop unexpectedly"); + lcd.locate(40,12); + lcd.printf("terminated"); error("Loop unexpectedly terminated"); } \ No newline at end of file