LED comes on if pin5 is on!

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
simno
Date:
Mon Sep 06 14:57:58 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 9606eb1f663f main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Sep 06 14:57:58 2010 +0000
@@ -0,0 +1,29 @@
+#include "mbed.h"
+
+//
+// This is my first go at reading DigitalIn.
+// If pin 5 is on, I light LED1.
+// Thus, running a wire from pin2 (+5v) to pin5 LED 1 comes on.
+// Also, running the Light Dependent Resistor (LDR) that came with my SKPANG kit
+// from pin2 to pin5 LED1 comes on if there is light
+// and goes off when the LDR is covered.
+//
+
+
+DigitalOut myled1(LED1);
+DigitalIn myIn5(p5);
+
+int main() 
+{
+    while(1) 
+    {
+        if (myIn5)
+        {
+            myled1 = 1;
+        }
+        else
+        {
+            myled1 = 0;
+        }
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r 9606eb1f663f mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Sep 06 14:57:58 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/e2ac27c8e93e