Lab 2 - Exercise 1 Analog to Digital Conversion using a variable potentiometer

Dependencies:   mbed

main.cpp

Committer:
brianconnett
Date:
2014-06-17
Revision:
0:1171c72f5f28
Child:
1:7e6087973b59

File content as of revision 0:1171c72f5f28:

//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); 
 } 
}