The Adafruit NeoPixel NeoMatrix 8x8 is a versatile and vibrant matrix of 64 individually addressable RGB LEDs, organized in an 8x8 grid. This component is part of the NeoPixel family, which integrates control circuitry directly into each LED, enabling users to control the color and brightness of each pixel independently. Common applications include creating colorful displays, animations, indicators, and other visually engaging projects.
Pin | Description |
---|---|
5V | Power supply voltage (4.5V to 5.5V) |
GND | Ground |
DIN | Data input from microcontroller |
DOUT | Data output for cascading multiple matrices |
#include <Adafruit_NeoPixel.h>
#define PIN 6 // Define the pin for data input
#define NUMPIXELS 64 // Number of pixels in the NeoMatrix
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
void setup() {
pixels.begin(); // Initialize the NeoPixel matrix
pixels.show(); // Initialize all pixels to 'off'
}
void loop() {
for(int i=0; i<NUMPIXELS; i++) {
pixels.setPixelColor(i, pixels.Color(150, 0, 90)); // Set color to purple
pixels.show(); // Update the matrix to show the new color
delay(50); // Delay for visibility
pixels.setPixelColor(i, pixels.Color(0, 0, 0)); // Turn off the pixel
}
}
Q: Can I control each LED individually? A: Yes, each LED can be controlled individually with its own color and brightness.
Q: How do I cascade multiple NeoMatrix panels? A: Connect the DOUT pin of one matrix to the DIN pin of the next. Ensure your microcontroller code addresses the increased number of LEDs.
Q: What is the maximum number of matrices I can cascade? A: The maximum is limited by the power supply and the microcontroller's memory. Ensure that the power supply can handle the current for all cascaded matrices and that the microcontroller has enough memory to store the LED color data.