Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By SergeS
#80823 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?
User avatar
By Pablo2048
#80845 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() :-)