An example program showing how to use the Potentiometer on the Embedded Artists baseboard

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
chris
Date:
Tue Mar 02 07:06:53 2010 +0000
Commit message:

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 43de45cb558c main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Mar 02 07:06:53 2010 +0000
@@ -0,0 +1,16 @@
+#include "mbed.h"
+
+// Potentionmeter is on mbed p15
+// Ensure J27 is fitted
+
+AnalogIn pot (p15);
+
+Serial pc (USBTX,USBRX);
+
+int main() {
+    while(1) {
+        float ain = pot;
+        pc.printf("Analog pot voltage = %.2fv\n",ain*3.3);
+        wait(0.2);
+    }
+}
diff -r 000000000000 -r 43de45cb558c mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Mar 02 07:06:53 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/49a220cc26e0