Using the Pixel Trinkey with DotStars and Arduino involves wiring up DotStars to the terminal block on the Trinkey, installing the Adafruit_DotStar library and running the provided example code.
Connect your DotStars to the terminal block on the Pixel Trinkey:
- Board GND to DotStar GND (black wire)
- Board DATA to DotStar DATA (blue wire)
- Board CLOCK to DotStar CLOCK (green wire)
- Board +5V to DotStar VIN (red wire)
Library Installation
You can install the Adafruit DotStar library for Arduino using the Library Manager in the Arduino IDE.
Click the Manage Libraries ... menu item, search for Adafruit DotStar, and select the Adafruit DotStar library:
If asked about dependencies, click "Install all".
If the "Dependencies" window does not come up, then you already have the dependencies installed.
If the dependencies are already installed, you must make sure you update them through the Arduino Library Manager before loading the example!
// SPDX-FileCopyrightText: 2024 ladyada for Adafruit Industries // // SPDX-License-Identifier: MIT #include <Adafruit_DotStar.h> #define NUMPIXELS 64 Adafruit_DotStar dotstrip(NUMPIXELS, PIN_DATA, PIN_CLOCK, DOTSTAR_BRG); void setup() { Serial.begin(115200); dotstrip.begin(); dotstrip.setBrightness(25); dotstrip.show(); } uint16_t firstPixelHue = 0; void loop() { firstPixelHue += 256; for(int i=0; i<dotstrip.numPixels(); i++) { int pixelHue = firstPixelHue + (i * 65536L / dotstrip.numPixels()); dotstrip.setPixelColor(i, dotstrip.gamma32(dotstrip.ColorHSV(pixelHue))); } dotstrip.show(); delay(10); }
Upload the sketch to your board. You'll see the attached DotStar strip cycle thru a rainbow animation on a loop.
Text editor powered by tinymce.