The Adafruit Trellis Monochrome Driver PCB is a unique and versatile component designed for creating interactive LED grids and button interfaces. This driver PCB can control a 4x4 array of buttons and LEDs, making it ideal for DIY projects such as custom keypads, musical instruments, or interactive displays. Its compatibility with microcontrollers, like the Arduino UNO, allows for easy integration into various electronic projects.
Pin | Description |
---|---|
VCC | Power supply (4.5V - 5.5V) |
GND | Ground connection |
SDA | I2C Data Line |
SCL | I2C Clock Line |
INT | Interrupt output (active-low) |
ADDR | Address selection pins (A0, A1, A2) |
RST | Reset pin (active-low) |
#include <Wire.h>
#include "Adafruit_Trellis.h"
Adafruit_Trellis matrix0;
void setup() {
Wire.begin();
matrix0.begin(0x70); // Initialize the first Trellis board at I2C address 0x70
// If chaining boards, initialize additional boards here
}
void loop() {
// Set LED state
matrix0.setLED(0); // Turn on LED at position 0
matrix0.clrLED(1); // Turn off LED at position 1
matrix0.writeDisplay(); // Write the changes to the board
// Read button state
if (matrix0.readSwitches()) {
if (matrix0.justPressed(0)) {
// Do something when button 0 is pressed
}
// Add additional button handling here
}
delay(100); // Debounce delay
}
Q: Can I use the Trellis with a 3.3V microcontroller? A: Yes, but ensure that the logic levels are compatible, and you may need level shifters for the I2C lines.
Q: How many Trellis boards can I chain together? A: You can chain up to 8 Trellis boards together, each with a unique I2C address.
Q: Can I control the brightness of the LEDs? A: The LEDs are either on or off; there is no built-in brightness control. However, you can simulate brightness control using PWM techniques with your microcontroller.
For further assistance, visit the Adafruit support forums or the product's FAQ page on the Adafruit website.