![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Lab 2 - Exercise 1 Analog to Digital Conversion using a variable potentiometer
Dependencies: mbed
Diff: main.cpp
- Revision:
- 0:1171c72f5f28
- Child:
- 1:7e6087973b59
diff -r 000000000000 -r 1171c72f5f28 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Jun 17 19:14:38 2014 +0000 @@ -0,0 +1,15 @@ +//Reads input through the ADC, and transfers to PC terminal +#include "mbed.h" + +Serial pc(USBTX, USBRX); +AnalogIn Ain(p20); +float ADCdata; + +int main() { + pc.printf("ADC Data Values... \n\r"); + while (1) { + ADCdata=Ain; + pc.printf("%f \n\r",ADCdata); + wait (0.5); + } +} \ No newline at end of file