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 Mac Lobdell

/media/uploads/maclobdell/austin_iot_lab.jpg

This project uses two 16x8 1.2" LED Matrix + Backpacks stuck together to make a 32x8 double-length matrix.

Committer:
maclobdell
Date:
Wed Jun 28 19:27:51 2017 +0000
Revision:
6:8d2eb79a4baf
Parent:
4:8641e4da6744
Child:
7:1bd79d71396a
create class for combined matrix with two 16 x 8 matrices stuck together

Who changed what in which revision?

UserRevisionLine numberNew contents of line
maclobdell 0:2eec8a9428ea 1 #include "mbed.h"
maclobdell 0:2eec8a9428ea 2
maclobdell 6:8d2eb79a4baf 3 #include "Adafruit_32x8matrix.h"
maclobdell 6:8d2eb79a4baf 4
maclobdell 6:8d2eb79a4baf 5 #define I2C_ADDR1 0x70
maclobdell 6:8d2eb79a4baf 6 #define I2C_ADDR2 0x71
maclobdell 6:8d2eb79a4baf 7 #define ROTATION1 0
maclobdell 6:8d2eb79a4baf 8 #define ROTATION2 2
maclobdell 6:8d2eb79a4baf 9 #define BRIGHTNESS 1
maclobdell 6:8d2eb79a4baf 10
maclobdell 6:8d2eb79a4baf 11 Serial pc (USBTX,USBRX);
maclobdell 6:8d2eb79a4baf 12
maclobdell 6:8d2eb79a4baf 13 void myidlethread(void);
maclobdell 6:8d2eb79a4baf 14
maclobdell 0:2eec8a9428ea 15 I2C i2c(D14, D15);
maclobdell 1:dd1d1b64b9a5 16
maclobdell 6:8d2eb79a4baf 17 Adafruit_32x8matrix matrix(&i2c, I2C_ADDR1, I2C_ADDR2, ROTATION1, ROTATION2, BRIGHTNESS);
maclobdell 1:dd1d1b64b9a5 18
maclobdell 0:2eec8a9428ea 19 int main() {
maclobdell 1:dd1d1b64b9a5 20
maclobdell 6:8d2eb79a4baf 21 char buffer [50];
maclobdell 6:8d2eb79a4baf 22 sprintf (buffer, "Welcome\0");
maclobdell 4:8641e4da6744 23
maclobdell 6:8d2eb79a4baf 24 Thread::attach_idle_hook(myidlethread);
maclobdell 6:8d2eb79a4baf 25
maclobdell 4:8641e4da6744 26 while(1)
maclobdell 4:8641e4da6744 27 {
maclobdell 6:8d2eb79a4baf 28 matrix.scrollText(buffer,strlen(buffer), 80);
maclobdell 6:8d2eb79a4baf 29
maclobdell 4:8641e4da6744 30 Thread::wait(10000);
maclobdell 4:8641e4da6744 31 }
maclobdell 1:dd1d1b64b9a5 32
maclobdell 1:dd1d1b64b9a5 33 }
maclobdell 1:dd1d1b64b9a5 34
maclobdell 4:8641e4da6744 35 void myidlethread(void)
maclobdell 4:8641e4da6744 36 {
maclobdell 4:8641e4da6744 37 sleep(); //go to sleep, wait for an interrupt
maclobdell 4:8641e4da6744 38
maclobdell 4:8641e4da6744 39 }
maclobdell 4:8641e4da6744 40
maclobdell 4:8641e4da6744 41