Example program for LPC General Purpose Shield using the Potentiometer

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 Serial pc(USBTX, USBRX);
00004 
00005 AnalogIn pot(A3);
00006 
00007 int main()
00008 {
00009     while(1) {
00010         pc.printf("Potentiometer = %.2f\n", (float)pot);
00011         wait(0.3);
00012     }
00013 }