Chris Styles
/
apps-shield-pots
Test program for mbed app shield pots
Fork of mbed-app-shield by
main.cpp@3:100dbea70564, 2014-02-06 (annotated)
- Committer:
- chris
- Date:
- Thu Feb 06 15:42:52 2014 +0000
- Revision:
- 3:100dbea70564
- Parent:
- 2:989f84939300
- Child:
- 4:f0eb984c583d
First check in
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
chris | 0:cca95aa94e09 | 1 | #include "mbed.h" |
chris | 2:989f84939300 | 2 | #include "C12832.h" |
chris | 0:cca95aa94e09 | 3 | |
chris | 3:100dbea70564 | 4 | C12832_LCD lcd(D11, D13, D12, D7, D10); |
chris | 1:e50da1f1f653 | 5 | |
chris | 3:100dbea70564 | 6 | AnalogIn pot1 (A0); |
chris | 3:100dbea70564 | 7 | AnalogIn pot2 (A1); |
chris | 0:cca95aa94e09 | 8 | |
chris | 0:cca95aa94e09 | 9 | int main() |
chris | 0:cca95aa94e09 | 10 | { |
chris | 0:cca95aa94e09 | 11 | while(1) { |
chris | 1:e50da1f1f653 | 12 | lcd.cls(); |
chris | 1:e50da1f1f653 | 13 | lcd.locate(0,3); |
chris | 3:100dbea70564 | 14 | lcd.printf("Pot 1 = %.2f", (float)pot1); |
chris | 3:100dbea70564 | 15 | lcd.locate(0,14); |
chris | 3:100dbea70564 | 16 | lcd.printf("Pot 2 = %.2f", (float)pot2); |
chris | 3:100dbea70564 | 17 | wait(0.1); |
chris | 0:cca95aa94e09 | 18 | } |
chris | 0:cca95aa94e09 | 19 | } |