Brandon_Stargrave
New member
Can anyone give me any tips on what could be wrong here. Teensy 4.1 and WS2812B Led strip. Seems like a pretty simple setup and I've tried different test code, different data pins, powering over USB or from a separate supply, basically everything I can think of. I've only rarely seen activity from the first few LEDs on the strip right after programming/rebooting, but they went dark right away. Mostly I'm just getting no response at all.
Code:
#define FASTLED_ALLOW_INTERRUPTS 0
#include <FastLED.h>
#define DATA_PIN 1
#define NUM_LEDS 20
CRGB leds[NUM_LEDS];
elapsedMillis tic;
void setup() {
//Serial.begin(115200);
//Serial.println("FastLed Test");
FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);
FastLED.setBrightness(50);
for (int i=0; i < NUM_LEDS; i++) {
leds[i] = CRGB::Black;
}
}
void loop() {
if (tic >= 333) {
/* Shift prior colors down all the LEDs */
for (int i=NUM_LEDS-1; i > 0; i--) {
leds[i] = leds[i - 1];
}
/* Turn the first LED on with a random color */
uint8_t red = random8();
uint8_t green = random8();
uint8_t blue = random8();
Serial.printf("R=%3d G=%3d B=%3d\n", red, green, blue);
leds[0].setRGB(red, green, blue);
FastLED.show();
tic = 0;
}
}