Example program for LPC General Purpose Shield using the Potentiometer

Dependencies:   mbed

Committer:
MACRUM
Date:
Mon Jul 27 09:35:37 2015 +0000
Revision:
0:e12ae8f22278
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew 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 }