mX mbed BaseBoard ADC

Dependencies:   mbed

Revision:
0:ae09939f31ae
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Dec 08 06:17:40 2010 +0000
@@ -0,0 +1,17 @@
+#include "mbed.h"
+
+AnalogIn ain(p20);
+DigitalOut led1(LED1);
+DigitalOut led2(LED2);
+DigitalOut led3(LED3);
+DigitalOut led4(LED4);
+
+int main() {
+    while (1){
+        led1 = (ain > 0.2) ? 1 : 0;
+        led2 = (ain > 0.4) ? 1 : 0;
+        led3 = (ain > 0.6) ? 1 : 0;
+        led4 = (ain > 0.8) ? 1 : 0;
+    }
+}
+