SAMI NAQVI
/
TALab3C_ADC
ECE595 - Lab 3 Part 3 - Analog2Digital - TA
Diff: main.cpp
- Revision:
- 0:f61eba51d14a
diff -r 000000000000 -r f61eba51d14a main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Feb 06 02:01:18 2022 +0000 @@ -0,0 +1,15 @@ +#include "mbed.h" +AnalogIn AnIn(A0); +DigitalOut led(LED1); +Serial pc(USBTX,USBRX); +float x; +int main() +{ + pc.printf(" ADC demo code\r\n"); + while (1) + { + x=AnIn.read(); + pc.printf("ADC0_Ch12=(%d)\r\n", x); + wait(.2); + } +} \ No newline at end of file