ldr blinky

Dependencies:   mbed

Revision:
0:1d3ca434d486
Child:
1:799a74dde023
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Jun 19 13:29:00 2014 +0000
@@ -0,0 +1,18 @@
+#include "mbed.h"
+
+DigitalOut r(PTC2);
+DigitalOut g(PTC1);
+AnalogIn ldr(A3);
+
+int main(){
+    while(1){
+        if(ldr>0.50){
+            g=1;
+            r=0;
+            }
+        else if(ldr<0.50){
+            g=0;
+            r=1;
+            }
+    }
+}
\ No newline at end of file