WS2812 LED light strips behaving strange

375 Views Asked by At

I had a long strip of WS2812 lights (300 LEDs) and had some code that was working completely fine. I decided to cut the strip so it would be the length of my desk but now the lights are acting strange and not following my code at all. I modified the code so it would work with the new length but now it doesn't work. I'm not sure if this is a hardware or software issue so I'll share the code I used and we can narrow it down from there. I simplified the code to light up just one LED but all the LEDs light up and are random colors which I have not had happen before. Here is the code:

#include <FastLED.h>

#define NUM_LEDS 10
#define LED_PIN 6
CRGB led[NUM_LEDS];

void setup() {
  delay(100);
  FastLED.addLeds<WS2812, LED_PIN>(led, NUM_LEDS);
}

void loop() {
  led[0] = CHSV(100, 255, 255);
  FastLED.show();
}

Let me know if there is more information you need and I will be happy to provide, thanks!

0

There are 0 best solutions below