The Adafruit Bicolor 8x8 LED Matrix Backpack is an electronic component designed to control an 8x8 bicolor (red and green) LED matrix. This backpack simplifies the process of driving the numerous LEDs and provides a way to interface with the matrix using a minimal number of pins through the I2C interface. It is commonly used in projects that require visual output, such as simple games, status indicators, or message displays.
Pin Number | Name | Description |
---|---|---|
1 | GND | Ground connection |
2 | VCC | Power supply (4.5V to 5.5V) |
3 | SDA | I2C Data line |
4 | SCL | I2C Clock line |
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_LEDBackpack.h>
Adafruit_BicolorMatrix matrix = Adafruit_BicolorMatrix();
void setup() {
matrix.begin(0x70); // Initialize the matrix with its I2C address
matrix.setBrightness(10); // Set the brightness to a medium level
}
void loop() {
matrix.clear(); // Clear the matrix display
matrix.drawPixel(0, 0, LED_GREEN); // Draw a green pixel in the top-left corner
matrix.writeDisplay(); // Write the changes to the display
delay(500);
matrix.clear();
matrix.drawPixel(7, 7, LED_RED); // Draw a red pixel in the bottom-right corner
matrix.writeDisplay();
delay(500);
}
This example initializes the matrix and alternates between lighting up a green pixel in the top-left corner and a red pixel in the bottom-right corner.
Q: Can I use this matrix with a 3.3V system? A: While the matrix is rated for 4.5V to 5.5V, some 3.3V systems may be able to drive it. However, level shifting for the I2C lines may be necessary.
Q: How do I change the I2C address? A: The I2C address can be changed by soldering the address jumpers on the back of the backpack to create a binary code corresponding to the desired address.
Q: Can I display multiple colors on a single LED? A: Each LED can display red, green, or a combination of both to appear yellow. Individual LEDs cannot display other colors or gradients.
Q: How many of these matrices can I chain together? A: You can chain up to eight matrices together by setting unique I2C addresses for each one.
For further assistance, consult the Adafruit support forums or the product's FAQ page.