0

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!

  • Maybe wiring would be helpful too. Many begginers doesn't connect GND (only the data pin), and it works quite randomly – KIIV May 16 '21 at 10:08
  • It ended up being a faulty light strip. Wanted to double check and make sure there was no errors in the code, thank you. –  Jul 12 '21 at 20:09

0 Answers0