![](/media/cache/profiles/1225293648e26d9c5e54e22e92197cb4.jpg.50x50_q85.jpg)
Test program for mbed app shield potentiometers
Fork of apps-shield-pots by
main.cpp@4:f0eb984c583d, 2014-08-01 (annotated)
- Committer:
- chris
- Date:
- Fri Aug 01 14:32:40 2014 +0000
- Revision:
- 4:f0eb984c583d
- Parent:
- 3:100dbea70564
Updated mbed library version
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 | 4:f0eb984c583d | 4 | C12832 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 | } |