-->
Page 1 of 2

WS2811 led strip, FasLED and PWM.

PostPosted: Tue Feb 26, 2019 9:00 pm
by SergeS
I have some project with WS2811 led strip, running with FastLED library. Strip is controlling by D8 pin (ESP8266 ESP-12 Lolin). Everything is working fine, but since i have added analogWrite(...) to control brightness of on-board led (pin D4) - all effects are distorted. What could be the problem? PWM on D4 is somehow related to bit-banging on D8? Common interrupts/timers? How to solve?

Re: WS2811 led strip, FasLED and PWM.

PostPosted: Thu Feb 28, 2019 3:47 am
by QuickFix
Are you powering the LED strip from its own power supply? :idea:

Re: WS2811 led strip, FasLED and PWM.

PostPosted: Thu Feb 28, 2019 4:04 am
by Pablo2048
The problem is IMHO obvious - ESP8266 don't have hardware PWM so your analogWrite() start timer to generate the PWM. According to the Core revision (are you using Arduino Core? Which version? Please don't be lazy to put all this info to your question next time...) in the latest 2.5 core was PWM generation changed AFAIK to avoid glitches. FastLED is realtime protocol so there are two ways to solve this:
1. search FastLED on how to use SPI pins to generate waveforms. This may help because is less sensitive to interrupts.
2. search the way how to disable interrupts inside FastLED - I'm not sure that this can be done, or don't use analogWrite() :-)

Re: WS2811 led strip, FasLED and PWM.

PostPosted: Thu Feb 28, 2019 4:35 am
by Pablo2048
Info about interrupts and FastLED (did You search for it?) https://github.com/FastLED/FastLED/wiki ... t-problems