
Example program for LPC General Purpose Shield using the Potentiometer
main.cpp@0:e12ae8f22278, 2015-07-27 (annotated)
- Committer:
- MACRUM
- Date:
- Mon Jul 27 09:35:37 2015 +0000
- Revision:
- 0:e12ae8f22278
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
MACRUM | 0:e12ae8f22278 | 1 | #include "mbed.h" |
MACRUM | 0:e12ae8f22278 | 2 | |
MACRUM | 0:e12ae8f22278 | 3 | Serial pc(USBTX, USBRX); |
MACRUM | 0:e12ae8f22278 | 4 | |
MACRUM | 0:e12ae8f22278 | 5 | AnalogIn pot(A3); |
MACRUM | 0:e12ae8f22278 | 6 | |
MACRUM | 0:e12ae8f22278 | 7 | int main() |
MACRUM | 0:e12ae8f22278 | 8 | { |
MACRUM | 0:e12ae8f22278 | 9 | while(1) { |
MACRUM | 0:e12ae8f22278 | 10 | pc.printf("Potentiometer = %.2f\n", (float)pot); |
MACRUM | 0:e12ae8f22278 | 11 | wait(0.3); |
MACRUM | 0:e12ae8f22278 | 12 | } |
MACRUM | 0:e12ae8f22278 | 13 | } |