Using the Pixel Trinkey with NeoPixels and Arduino involves wiring up NeoPixels to the terminal block on the Trinkey, installing the Adafruit_NeoPixel library and running the provided example code.
Connect your NeoPixels to the terminal block on the Pixel Trinkey:
- Board GND to NeoPixel GND (black wire)
- Board DATA to NeoPixel DATA IN (blue wire)
- Board +5V to NeoPixel VIN (red wire)
Library Installation
You can install the Adafruit NeoPixel library for Arduino using the Library Manager in the Arduino IDE.
Click the Manage Libraries ... menu item, search for Adafruit NeoPixel, and select the Adafruit NeoPixel library:
There are no additional dependencies for the Adafruit NeoPixel library.
// SPDX-FileCopyrightText: 2024 ladyada for Adafruit Industries // // SPDX-License-Identifier: MIT #include <Adafruit_NeoPixel.h> #define NUMPIXELS 64 Adafruit_NeoPixel neostrip(NUMPIXELS, PIN_DATA, NEO_GRB + NEO_KHZ800); void setup() { Serial.begin(115200); neostrip.begin(); neostrip.setBrightness(25); neostrip.show(); } uint16_t firstPixelHue = 0; void loop() { firstPixelHue += 256; for(int i=0; i<neostrip.numPixels(); i++) { int pixelHue = firstPixelHue + (i * 65536L / neostrip.numPixels()); neostrip.setPixelColor(i, neostrip.gamma32(neostrip.ColorHSV(pixelHue))); } neostrip.show(); delay(10); }
Upload the sketch to your board. You'll see the attached NeoPixel strip cycle thru a rainbow animation on a loop.
Text editor powered by tinymce.