Sample code to operate 6 of PCA9622_LED8x8 module

Dependencies:   PCA9622_LED8x8 mbed

Simple demo program to show 6 of PCA9622_LED8x8 modules individually.

Component page is available

Please refer to the component page for for more information.

I2C 8x8 LED matrix board" from Switch Science

Files at this revision

API Documentation at this revision

Comitter:
nxp_ip
Date:
Thu Dec 25 05:41:53 2014 +0000
Child:
1:c7c3b6e41ba2
Commit message:
Sample code to operate six of PCA9622_LED8x8 module

Changed in this revision

PCA9622_LED8x8.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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PCA9622_LED8x8.lib	Thu Dec 25 05:41:53 2014 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/nxp_ip/code/PCA9622_LED8x8/#cd00372373e4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Dec 25 05:41:53 2014 +0000
@@ -0,0 +1,57 @@
+/**
+ *  Sample code to operate 6 of PCA9622_LED8x8 module
+ *
+ *  @author  Tedd OKANO
+ *  @version 1.0
+ *  @date    25-Dec-2014
+ */
+
+#include "mbed.h"
+#include "PCA9622_LED8x8.h"
+
+I2C  i2c( p28, p27 );
+
+PCA9622_LED8x8  matrix[]    = {
+    PCA9622_LED8x8( i2c, 0xA0 ),
+    PCA9622_LED8x8( i2c, 0xA2 ),
+    PCA9622_LED8x8( i2c, 0xA4 ),
+    PCA9622_LED8x8( i2c, 0xA6 ),
+    PCA9622_LED8x8( i2c, 0xA8 ),
+    PCA9622_LED8x8( i2c, 0xAA )
+};
+
+static char bm_nxp[] = {
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+    0xFF, 0xFF, 0xFF, 0xF0, 0x78, 0x3C, 0x1E, 0x0F,
+    0xFF, 0x7E, 0xBD, 0xDB, 0xE7, 0x7E, 0x3C, 0x18,
+    0x3C, 0x7E, 0xE7, 0xDB, 0xBD, 0x7E, 0xFF, 0xCC,
+    0xCC, 0xCC, 0xCC, 0xCC, 0xFC, 0x78, 0x78,
+
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+};
+
+#define     N_OF_MTX    6
+
+int main()
+{
+    float   image[ 8 ][ 8 ];
+    int     index;
+    int     count   = 0;
+
+    while(1) {
+
+        for ( int offset = 0; offset < N_OF_MTX; offset++) {
+            index       = ((count + offset * 11) % (sizeof( bm_nxp ) - 8));
+            for ( int i = 0; i < 8; i++ ) {
+                for ( int j = 0; j < 8; j++ ) {
+                    image[ j ][ 7 - i ]   = (bm_nxp[ index + j ] >> (7 - i)) & 0x1;
+                }
+            }
+            matrix[ offset ].set_data( image );
+        }
+
+        count++;
+        wait( 0.02 );
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Dec 25 05:41:53 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/4fc01daae5a5
\ No newline at end of file