Library to drive a pair of Adafruit 16x8 led matrices (powered by Adafruit LED Backpack) rotated end to end and stuck together to make a larger matrix.
Dependencies: Adafruit_LEDBackpack
Dependents: Adafruit_LEDBackpack_32x8_App RubeGoldberg
Adafruit_32x8matrix.h@2:cdcd2d7d83c3, 2017-12-11 (annotated)
- Committer:
- maclobdell
- Date:
- Mon Dec 11 19:22:54 2017 +0000
- Revision:
- 2:cdcd2d7d83c3
- Parent:
- 1:ed6764fbda54
added playText function which parses a sentence and either shows the individual words (for short words under 5 chars), or scrolls them for words equal to or greater than 5 chars. also updated mbed-os library.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
maclobdell | 0:acc3c726ffe3 | 1 | #ifndef _ADAFRUIT_32X8MATRIX_H_ |
maclobdell | 0:acc3c726ffe3 | 2 | #define _ADAFRUIT_32X8MATRIX_H_ |
maclobdell | 0:acc3c726ffe3 | 3 | |
maclobdell | 0:acc3c726ffe3 | 4 | #include "Adafruit_LEDBackpack.h" |
maclobdell | 0:acc3c726ffe3 | 5 | #include "Adafruit_GFX.h" |
maclobdell | 0:acc3c726ffe3 | 6 | |
maclobdell | 0:acc3c726ffe3 | 7 | //notes |
maclobdell | 0:acc3c726ffe3 | 8 | //220uA no leds on |
maclobdell | 0:acc3c726ffe3 | 9 | //default brightness - rises to 20mA at short peak then back down when scrolling hello |
maclobdell | 0:acc3c726ffe3 | 10 | //brightness = 1, rises to ~4mA at short peak then back down when scrolling hello |
maclobdell | 0:acc3c726ffe3 | 11 | |
maclobdell | 0:acc3c726ffe3 | 12 | |
maclobdell | 0:acc3c726ffe3 | 13 | class Adafruit_32x8matrix { |
maclobdell | 0:acc3c726ffe3 | 14 | public: |
maclobdell | 0:acc3c726ffe3 | 15 | Adafruit_32x8matrix(I2C *i2c, uint8_t i2c_addr, uint8_t i2c_addr2, uint8_t rotation, uint8_t rotation2, uint8_t brightness); |
maclobdell | 0:acc3c726ffe3 | 16 | |
maclobdell | 0:acc3c726ffe3 | 17 | void scrollText(char * , uint8_t , uint8_t ); |
maclobdell | 0:acc3c726ffe3 | 18 | void showText(char * , uint8_t , uint8_t ); |
maclobdell | 2:cdcd2d7d83c3 | 19 | void playText(char * , uint8_t , uint8_t ); |
maclobdell | 2:cdcd2d7d83c3 | 20 | |
maclobdell | 0:acc3c726ffe3 | 21 | private: |
maclobdell | 1:ed6764fbda54 | 22 | I2C *_i2c; |
maclobdell | 0:acc3c726ffe3 | 23 | Adafruit_16x8matrix _matrix; |
maclobdell | 0:acc3c726ffe3 | 24 | Adafruit_16x8matrix _matrix2; |
maclobdell | 0:acc3c726ffe3 | 25 | uint8_t _i2c_addr; |
maclobdell | 0:acc3c726ffe3 | 26 | uint8_t _i2c_addr2; |
maclobdell | 0:acc3c726ffe3 | 27 | uint8_t _rotation; |
maclobdell | 0:acc3c726ffe3 | 28 | uint8_t _rotation2; |
maclobdell | 0:acc3c726ffe3 | 29 | uint8_t _brightness; |
maclobdell | 0:acc3c726ffe3 | 30 | |
maclobdell | 0:acc3c726ffe3 | 31 | }; |
maclobdell | 0:acc3c726ffe3 | 32 | |
maclobdell | 1:ed6764fbda54 | 33 | #endif |