![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Simple test for Version Control System
Diff: main.cpp
- Branch:
- Test_AnalogIn
- Revision:
- 3:083b8bb2bb8b
- Parent:
- 2:c4d361e4a860
- Child:
- 4:6a426b4967e5
diff -r c4d361e4a860 -r 083b8bb2bb8b main.cpp --- a/main.cpp Wed May 24 12:17:48 2017 +0000 +++ b/main.cpp Wed May 24 12:26:14 2017 +0000 @@ -1,12 +1,18 @@ #include "mbed.h" +Serial pc(USBTX, USBRX); DigitalOut myled1(LED1); +AnalogIn Ain(p20); // Analog input int main() { + float ADCdata; while(1) { myled1 = 1; wait(0.5); myled1 = 0; wait(1.0); + ADCdata=Ain.read(); + pc.printf("%f\t%fV \n\r",ADCdata, ADCdata*3.3); + wait(0.5); } }