File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change 2323#define DEFAULT_WIRE Wire
2424#endif
2525
26+ #define DEFAULT_ADDRESS 0x39
27+
2628class ModulinoLEDMatrix
2729#ifdef MATRIX_WITH_ARDUINOGRAPHICS
2830 : public ArduinoGraphics
2931#endif
3032 {
3133
3234public:
33- ModulinoLEDMatrix (HardwareI2C& wire = DEFAULT_WIRE)
35+ ModulinoLEDMatrix (uint8_t address = DEFAULT_ADDRESS, HardwareI2C& wire = DEFAULT_WIRE)
3436 #ifdef MATRIX_WITH_ARDUINOGRAPHICS
3537 : ArduinoGraphics(canvasWidth, canvasHeight)
3638 #endif
3739 {
40+ _address = address;
3841 _wire = &wire;
3942 }
43+
44+ ModulinoLEDMatrix (HardwareI2C& wire, uint8_t address = DEFAULT_ADDRESS)
45+ #ifdef MATRIX_WITH_ARDUINOGRAPHICS
46+ : ArduinoGraphics(canvasWidth, canvasHeight)
47+ #endif
48+ {
49+ _address = address;
50+ _wire = &wire;
51+ }
52+
4053 // TODO: find a better name
4154 // autoscroll will be slower than calling next() at precise times
4255 void autoscroll (uint32_t interval_ms) {
@@ -63,7 +76,7 @@ class ModulinoLEDMatrix
6376 }
6477 _sequenceDone = true ;
6578 }
66- _wire->beginTransmission (0x39 );
79+ _wire->beginTransmission (_address );
6780 _wire->write ((uint8_t *)frame, sizeof (frame));
6881 _wire->endTransmission ();
6982 }
@@ -219,4 +232,5 @@ class ModulinoLEDMatrix
219232 bool _sequenceDone = false ;
220233 voidFuncPtr _callBack = nullptr ;
221234 HardwareI2C* _wire;
235+ uint8_t _address = 0 ;
222236};
You can’t perform that action at this time.
0 commit comments