John Davis / Mbed 2 deprecated Lab2

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
m161440
Date:
Tue Sep 09 01:06:51 2014 +0000
Commit message:
lab 2 exercise 1

Changed in this revision

Exercise1.cpp 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/Exercise1.cpp	Tue Sep 09 01:06:51 2014 +0000
@@ -0,0 +1,20 @@
+#include "mbed.h"
+Serial pc(USBTX, USBRX);
+AnalogIn voltage(p20);
+
+  int main()
+  {
+    pc.baud(921600);
+    
+    
+    while(1)
+    {
+        float v= voltage;
+        voltage.read();
+        printf("analog value = %f\n",v);
+        printf("voltage = %f \n",3.3*v);
+        wait(.5);
+    }
+    
+      
+      }
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Sep 09 01:06:51 2014 +0000
@@ -0,0 +1,20 @@
+#include "mbed.h"
+Serial pc(USBTX, USBRX);
+AnalogIn voltage(p20);
+
+  int main()
+  {
+    pc.baud(921600);
+    
+    
+    while(1)
+    {
+        float v= voltage;
+        voltage.read();
+        printf("analog value = %f\n",v);
+        printf("voltage = %f \n",3.3*v);
+        wait(.5);
+    }
+    
+      
+      }
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Sep 09 01:06:51 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9327015d4013
\ No newline at end of file