Hi there,
I have no experience with FastLED.
I am trying to blink with WS2812B (you can see the code below) and when LED is changing color to another color then I don’t know why but white color comes out pls take a look at the video.
I am using Arduino MiniPro 16MHz/5V
CODE: #include “FastLED.h”
#define NUM_LEDS 1 #define DATA_PIN 3
CRGB leds[NUM_LEDS];
unsigned long lastChange = 0;
const long interval = 500;
i don’t see the issue and can’t test the code but what i saw is the fact that the white comes every second assignement. It’s like every second time its running out of range and showing white… but this is just my observation… could also be missleading
try once FastLED.addLeds<WS2812,DATA_PIN>(leds, NUM_LEDS)
Hi,
I have tested your update, but nothing has changed.
As you correctly observed, LED turns to white color any time when I want to change to another color. So when the led is green and has to change color to red ( or any other color) there is some intermediate step over white.
mhmm i can’t test the code because i’m missing the hardware right now.
Just as tip the fastled libary brings a macro for:
EVERY_N_MILLISECONDS(500)
{
//do something every 500 ms
}
Do you power the led from the same source as the arduino?
hi @Roman_MrAntonka_Fojt ,
I ran your code on my ws2812bs without seeing any flashing white during colour changes. The only thing i changed was the setup to match my rig.
Serveral suggestions:
check wiring and soldering (’+ tie LED & IC’s grounds together)
slip in a fastled.clear() call before swapping colours
make sure you have the right colour order in the setup (there’s a sketch in the example folder of the Fastled distribution to establish that)
put a cap across the LEDs’ pos and neg, + a smallish resistor on the data line. Costs (next-to) nothing, does no harm and might help (see: neopixel uberguide - best practises)
If all fails, you could also try using a different LED or a different pin on your Arduino (you never know, either could somehow be dodgy). If it still doesn’t work then I’m out of ideas because I’m also just dabbling.
other note:
the random function’s upper bound is exclusive. As it is in your code, the blue will never be called.
@Severin_N Yes I am using the same power supply for both devices.
and i have tryed your update but there is no change - I have tried a lot of different code from the internet but nothing works well. -> HW/wiring problem
@matt_p hi nice to hear.
grounds together - already done at the beginning.
FastLED.clear() - no effects
capacitors 1000uf - already done at the beginning.
OK, ALL FAILS
I have to change the arduino to another one and LEDs too.
Have you tried to adress another led?
What di you mean with there is no change? Therw should be one. If there is absolutly no change i would say the upload failed…
Sorry but the wirering / soldering cant be that wrong after all. Otherwise it woulden’t light up at all…
There is a ws2811_400hz type… Probably that one?
Thanks… So it did change it behaviour but still you have the white in between… This is amazing… Sorry i don’t have any explonation for that behaviour… (But im new to that electrical stuff also do there are more experienced guys than me )
Ah and a good idea is to set the brightness to lower… My leds startet to die while running them on full brightness. So http://fastlet.setbrightness(128) should do the job.