The Adafruit DotStar Wing is an add-on board designed for controlling APA102 LEDs, commonly known as DotStar LEDs. These high-quality RGB LEDs are known for their vibrant colors and fast refresh rates, making them ideal for a wide range of applications including decorative lighting, signal indicators, and advanced light displays. The DotStar Wing simplifies the process of connecting DotStar LED strips to microcontrollers, such as the Arduino UNO, by providing a convenient interface and additional features to enhance LED control.
Pin Number | Function | Description |
---|---|---|
1 | GND | Ground connection |
2 | VCC | Power supply for the LEDs (3.3V to 5V) |
3 | Data In (DI) | Data input for LED control |
4 | Clock In (CI) | Clock input for synchronizing data transmission |
#include <Adafruit_DotStar.h>
#include <SPI.h> // Use SPI library to communicate with DotStar
#define NUMPIXELS 30 // Number of LEDs in the strip
#define DATAPIN 4 // Data pin connected to DotStar data input
#define CLOCKPIN 5 // Clock pin connected to DotStar clock input
// Create DotStar object
Adafruit_DotStar strip = Adafruit_DotStar(NUMPIXELS, DATAPIN, CLOCKPIN, DOTSTAR_BRG);
void setup() {
strip.begin(); // Initialize pins for output
strip.show(); // Turn all LEDs off ASAP
}
void loop() {
colorWipe(strip.Color(255, 0, 0), 50); // Red color wipe
colorWipe(strip.Color(0, 255, 0), 50); // Green color wipe
colorWipe(strip.Color(0, 0, 255), 50); // Blue color wipe
}
// Fill strip with a color, one pixel at a time
void colorWipe(uint32_t color, int wait) {
for(int i=0; i<strip.numPixels(); i++) { // For each pixel in strip...
strip.setPixelColor(i, color); // Set pixel's color (in RAM)
strip.show(); // Update strip to match
delay(wait); // Pause for a moment
}
}
Q: Can I control multiple DotStar strips with one Wing? A: Yes, you can control multiple strips by connecting their data and clock lines in parallel to the Wing's DI and CI pins, respectively.
Q: What is the maximum length of the LED strip I can control with the DotStar Wing? A: The maximum length depends on your power supply's capacity and the data signal integrity. For longer strips, power injection and signal amplification may be necessary.
Q: How do I change the brightness of the LEDs?
A: You can use the setBrightness()
function in the Adafruit_DotStar library to adjust the brightness of the entire strip.
Q: Can I use the DotStar Wing with a 3.3V logic microcontroller? A: Yes, the Wing is 5V logic tolerant, but for reliable operation, a level shifter is recommended when using a 3.3V logic microcontroller.