Datasheet
Changing the address in your code
Once you've adjusted the address on the backpack, you'll also want to adjust the address in the code!
For the Arduino library we wrote, its simple. For example, lets say you want to have two seven-segment matrices. One
is set to address 0x70 and the other is set to 0x71. Find this code in the example
And change it to this:
That is, instantiate two matrix objects. Then one is called with begin(0x70) and the other is called with begin(0x71).
Each one can be used individually. If you need more matrices, just instantiate more objects at the top and begin() each
one with the unique i2c address.
Adafruit_7segment matrix = Adafruit_7segment();
void setup() {
Serial.begin(9600);
Serial.println("7 Segment Backpack Test");
matrix.begin(0x70);
}
Adafruit_7segment matrix1 = Adafruit_7segment();
Adafruit_7segment matrix2 = Adafruit_7segment();
void setup() {
Serial.begin(9600);
Serial.println("Double 7 Segment Backpack Test");
matrix1.begin(0x70);
matrix2.begin(0x71);
}
© Adafruit Industries https://learn.adafruit.com/adafruit-led-backpack Page 62 of 74










