Example application for two 16x8 Adafruit LED Backpacks to make a 32 x 8 matrix.
Dependencies: Adafruit_32x8matrix
Fork of Adafruit_LEDBackpack_16x8_App by
This project uses two 16x8 1.2" LED Matrix + Backpacks stuck together to make a 32x8 double-length matrix.
main.cpp
- Committer:
- maclobdell
- Date:
- 2017-06-28
- Revision:
- 7:1bd79d71396a
- Parent:
- 6:8d2eb79a4baf
- Child:
- 8:5f5ceafa826d
File content as of revision 7:1bd79d71396a:
#include "mbed.h" #include "Adafruit_32x8matrix.h" #define I2C_ADDR1 0x70 #define I2C_ADDR2 0x71 #define ROTATION1 0 #define ROTATION2 2 #define BRIGHTNESS 1 Serial pc (USBTX,USBRX); void myidlethread(void); I2C i2c(D14, D15); Adafruit_32x8matrix matrix(&i2c, I2C_ADDR1, I2C_ADDR2, ROTATION1, ROTATION2, BRIGHTNESS); int main() { char buffer [50]; Thread::attach_idle_hook(myidlethread); sprintf(buffer, "This\0"); matrix.showText(buffer,strlen(buffer), 1); sprintf(buffer, "is\0"); matrix.showText(buffer,strlen(buffer), 1); sprintf(buffer, "the\0"); matrix.showText(buffer,strlen(buffer), 1); sprintf (buffer, "IoT Lab\0"); matrix.scrollText(buffer,strlen(buffer), 100); Thread::wait(1000); sprintf(buffer, "Welcome\0"); while(1) { matrix.scrollText(buffer,strlen(buffer), 80); Thread::wait(10000); } } void myidlethread(void) { sleep(); //go to sleep, wait for an interrupt }