Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use Adafruit NeoTrellis 4x4: Examples, Pinouts, and Specs

Image of Adafruit NeoTrellis 4x4Design with Adafruit NeoTrellis 4x4 in Cirkit Designer

Introduction

The Adafruit NeoTrellis 4x4 is a programmable keypad with a built-in RGB LED for each button. This interactive and visually appealing component is perfect for creating custom user interfaces, musical instruments, and gaming controls. Its versatility allows it to be used in a wide range of projects, from simple educational tools to complex interactive installations.

Explore Projects Built with Adafruit NeoTrellis 4x4

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Arduino Mega-Nano Hybrid Control Panel with Wireless Communication and LED Displays: A project utilizing Adafruit NeoTrellis 4x4 in a practical application
Arduino Mega-Nano Hybrid Control Panel with Wireless Communication and LED Displays

This is a multifunctional interactive system featuring an Arduino Mega 2560 and an Arduino Nano for control. It includes user input components (pushbuttons, keypad), visual output (OLED displays, LED matrices, NeoPixel rings/jewels), audio output (DFPlayer MINI with loudspeakers), and wireless communication (433MHz RF transmitter). The system is designed for user interaction, feedback display, and wireless control, with placeholder code for future development.

Open Project in Cirkit Designer

Common Applications and Use Cases

Technical Specifications

Key Technical Details

Pin Configuration and Descriptions

Pin Description
VDD Power supply (2.5V to 5.5V)
GND Ground
SCL I2C clock line
SDA I2C data line
INT Interrupt output (active low)
RST Reset input (active low)

Usage Instructions

How to Use the Component in a Circuit

  1. Powering the NeoTrellis: Connect the VDD pin to a 2.5V to 5.5V power supply and the GND pin to the ground.
  2. I2C Communication: Connect the SCL and SDA pins to the I2C clock and data lines on your microcontroller (e.g., Arduino UNO).
  3. Interrupts (Optional): The INT pin can be connected to an interrupt-capable pin on your microcontroller to handle button press events.
  4. Reset (Optional): The RST pin can be connected to a digital pin on your microcontroller if you wish to reset the NeoTrellis programmatically.

Important Considerations and Best Practices

Example Code for Arduino UNO

#include <Wire.h>
#include "Adafruit_NeoTrellis.h"

Adafruit_NeoTrellis trellis;

void setup() {
  Wire.begin();
  trellis.begin();
  // Activate all keys and LEDs for the NeoTrellis
  for (int i = 0; i < 16; i++) {
    trellis.activateKey(i, SEESAW_KEYPAD_EDGE_RISING, true);
    trellis.setPixelColor(i, 0x000000); // Start with all LEDs off
  }
  trellis.show();
}

void loop() {
  // If available, read key event
  if (trellis.available()) {
    keypadEvent e = trellis.read();
    if (e.bit.EDGE == SEESAW_KEYPAD_EDGE_RISING) {
      trellis.setPixelColor(e.bit.NUM, 0xFFFFFF); // Turn on LED when button is pressed
      trellis.show();
    }
  }
}

Troubleshooting and FAQs

Common Issues

Solutions and Tips for Troubleshooting

FAQs

Q: Can I connect multiple NeoTrellis boards together? A: Yes, you can daisy-chain multiple boards using the I2C bus. Make sure to configure unique I2C addresses for each board.

Q: How do I change the color of an LED? A: Use the setPixelColor function with the button number and desired RGB color value.

Q: What is the maximum number of NeoTrellis boards I can chain together? A: The maximum number is limited by the I2C address space and the power supply capability. Typically, you can chain several boards without issues.

Q: Can I use the NeoTrellis with platforms other than Arduino? A: Yes, the NeoTrellis can be used with any microcontroller that supports I2C communication. Adjust the code accordingly for your platform.