Esercitazione 2 - 3

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
MDevolution
Date:
Mon Oct 10 09:35:18 2016 +0000
Commit message:
Esercitazione 2 - 3

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r c54d5caee39f main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Oct 10 09:35:18 2016 +0000
@@ -0,0 +1,18 @@
+//Program Example 3: Reads input voltage through the ADC, and transfers to PC terminal
+
+#include "mbed.h"
+
+Serial pc(USBTX, USBRX); //enable serial port which links to USB
+AnalogIn Ain(A0);
+float ADCdata;
+
+int main(){
+    pc.printf("ADC Data Values...\n\r"); //send an opening text message
+    
+    while(1){
+        ADCdata=Ain*3.3;
+        wait(0.5);
+        pc.printf("%1.3f",ADCdata);
+        pc.printf("V\n\r");
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r c54d5caee39f mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Oct 10 09:35:18 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/25aea2a3f4e3
\ No newline at end of file