Hello,
my problem is the communication between PIN6 from the controller (Arduino Uno) and DIN. I have tried FastLED and NeoPixel library, but the problem stays the same. I have written a code which should power every color (red, green, blue) of every single LED, starting with the first.
What happens is that the first LED does its job correct, but then it is the second's task, the second in the strip shows wrong colors and changes the first LED too. The third LED does the same with the second one, and then the fourth LED should do it's task, only the third changes colors.
I'm guessing the DATA words that get overhanded are like shortened with every WS2812B, since the fourth LED gets no signal to do something and the other tasks before in the strip are messed up.
Hopefully you know what's going on, thanks for reply =)
Setup:
- Arduino Uno
- LED strip WS2812B (4 LEDs)
- 330 ohms resistor between PIN6 and DIN (strip)
- 5V and GND from Uno to strip
- Arduino IDE 1.8.4
- Adafruit NeoPixel library
The code I use:
#include <Adafruit_NeoPixel.h>
#define PIXEL_PIN 6
#define PIXEL_COUNT 4
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(PIXEL_COUNT, PIXEL_PIN, NEO_GRB + NEO_KHZ800);
void setup() {
pixels.begin();
}
void loop() {
// RGB LED1
pixels.setPixelColor(0, pixels.Color(150,0,0));
pixels.show();
delay(500);
pixels.setPixelColor(0, pixels.Color(0,150,0));
pixels.show();
delay(500);
pixels.setPixelColor(0, pixels.Color(0,0,150));
pixels.show();
delay(1000);
// RGB LED2
pixels.setPixelColor(1, pixels.Color(150,0,0));
pixels.show();
delay(500);
pixels.setPixelColor(1, pixels.Color(0,150,0));
pixels.show();
delay(500);
pixels.setPixelColor(1, pixels.Color(0,0,150));
pixels.show();
delay(1000);
// RGB LED3
pixels.setPixelColor(2, pixels.Color(150,0,0));
pixels.show();
delay(500);
pixels.setPixelColor(2, pixels.Color(0,150,0));
pixels.show();
delay(500);
pixels.setPixelColor(2, pixels.Color(0,0,150));
pixels.show();
delay(1000);
// RGB LED4
pixels.setPixelColor(3, pixels.Color(150,0,0));
pixels.show();
delay(500);
pixels.setPixelColor(3, pixels.Color(0,150,0));
pixels.show();
delay(500);
pixels.setPixelColor(3, pixels.Color(0,0,150));
pixels.show();
delay(1000);
}