Example program for LPC General Purpose Shield using LEDs

Dependencies:   PCAL955x mbed

Files at this revision

API Documentation at this revision

Comitter:
MACRUM
Date:
Mon Jul 27 08:52:54 2015 +0000
Commit message:
Initial commit

Changed in this revision

PCAL955x.lib Show annotated file Show diff for this revision Revisions of this file
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 88bc691c83cb PCAL955x.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PCAL955x.lib	Mon Jul 27 08:52:54 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/nxp_ip/code/PCAL955x/#fd7cfa821b6a
diff -r 000000000000 -r 88bc691c83cb main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Jul 27 08:52:54 2015 +0000
@@ -0,0 +1,29 @@
+#include "mbed.h"
+#include "PCAL9555.h"
+ 
+PCAL9555    gpio_exp(SDA, SCL);
+GpioBusOut  leds(gpio_exp, X1_4, X1_5, X1_6, X1_7);
+ 
+enum key_num {
+    OM13082_LD1 = (1 << 0),
+    OM13082_LD2 = (1 << 1),
+    OM13082_LD3 = (1 << 2),
+    OM13082_LD4 = (1 << 3),
+};
+ 
+int main()
+{
+    while(1) {
+        leds.write(0xF);
+        wait(0.3);
+        leds.write(~OM13082_LD1);
+        wait(0.3);
+        leds.write(~OM13082_LD2);
+        wait(0.3);
+        leds.write(~OM13082_LD3);
+        wait(0.3);
+        leds.write(~OM13082_LD4);
+        wait(0.3);
+    }
+}
+ 
\ No newline at end of file
diff -r 000000000000 -r 88bc691c83cb mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Jul 27 08:52:54 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/bad568076d81
\ No newline at end of file