Library for "I2C 8x8 LED matrix board" from Switch Science https://www.switch-science.com/catalog/2071/
Dependents: PCA9622_LED8x8_Demo PCA9622_LED8x8_Hello PCA9622_LED8x8_x6_Demo shake-shake-machine
You are viewing an older revision! See the latest version
Homepage
What is this?¶
I2C interface single color LED matrix module with PCA9622(LED controller).
This library provides interface from memory array to LEDs, manages scan.
Brightness control can be done for each pixels by setting data as float value (from 0.0 to 1.0).
How to use¶
Sample code is available.
Next is simplified code sample that makes still image on the LEDs.
In the main() function, the library operation is started by start() function and image data is set by set_data().
The image data is stored in 2 dimensional float array.
#include "mbed.h" #include "PCA9622_LED8x8.h" PCA9622_LED8x8 matrix( p28, p27 ); // I2C pins. SDA and SCL int main() { float image[ 8 ][ 8 ]; matrix.start(); // making 8x8 image to "image" array for ( int i = 0; i < 8; i++ ) for ( int j = 0; j < 8; j++ ) image[ i ][ j ] = (i + 1) * (j + 1) / 64.0; // set the image into library internal bufer matrix.set_data( image ); while(1) ; }