Example program to print 100 samples of pot1 on the mbed Application Board to the USB serial port

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
chris
Date:
Thu Apr 18 12:48:24 2013 +0000
Commit message:
First revision

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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Apr 18 12:48:24 2013 +0000
@@ -0,0 +1,16 @@
+#include "mbed.h"
+
+AnalogIn pot1(p19);
+DigitalOut myled(LED1);
+
+int main()
+{
+
+    for (int i=0; i < 100 ; i++) {
+        printf("%.2f\n",pot1.read());
+        wait(0.05);
+        myled = !myled;
+    }
+    myled = 1;
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Apr 18 12:48:24 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/7e6c9f46b3bd
\ No newline at end of file