Volt measure from serial connection of 4x820Ohm resistors using print over USBSerial to PC (TeraTerm)

Dependencies:   USBDevice mbed

/media/uploads/robert_gutknecht/2013-04-08_21.37.52.jpg /media/uploads/robert_gutknecht/_scaled_2013-04-08_21.38.33.jpg

Files at this revision

API Documentation at this revision

Comitter:
robert_gutknecht
Date:
Tue Apr 09 08:39:51 2013 +0000
Child:
1:30c120997cb2
Commit message:
volt mesure

Changed in this revision

USBDevice.lib Show annotated file Show diff for this revision Revisions of this file
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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/USBDevice.lib	Tue Apr 09 08:39:51 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/USBDevice/#354942d2fa38
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Apr 09 08:39:51 2013 +0000
@@ -0,0 +1,23 @@
+#include "mbed.h"
+#include "USBSerial.h"
+AnalogIn ain(p15);
+ DigitalOut myled1(LED1);
+//Virtual serial port over USB
+USBSerial serial;
+ 
+int main(void) {
+    int count=0;
+    double volt=0;
+    
+    while(1)
+    {
+        volt=((ain.read())*3.3);
+        ++count;
+        serial.printf("%d.Messung: %f\r\n",count,volt);
+        myled1= 1;
+        
+        wait(1);
+        myled1=0;
+        wait(1);
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Apr 09 08:39:51 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/5e5da4a5990b
\ No newline at end of file