g6ejd wrote:Observations: The ESP8266 is not a hardware PWM implementation, so software based and uses interrupt initiated timers, therefore there will be a small amount of variability in PWM output/lengths. At low PWM values I have noticed occasional flickering of LED's like a short burst of full brightness followed by periods of correct brightness, which I presume is a function of other activity like network tasks taking priority. Try a slower PWM frequency, I don't know what frequency your using but maybe 100-200Hz would help reduce flickering.
The affect your seeing is probably due to PWM resolution as AFGAIK the PWM does not change until a threshold of change has been detected, perhaps increase your brightness levels in steps of 2 or more. What resolution does your programme work to 1024? the same as the PWM channel?
I'm trying to make full use of the 1024 resolution in order to get a smooth fade. At low PWM values using bright leds, each increment makes a noticeable increase in brightness. At the low end the more resolution the better. Gamma correction doesn't come into play until PWM values exceed 10 or 15. After that, increments need to get exponentially larger. If I have to skip all even PWM values then my resolution drops to 512. Can somebody confirm what I'm experiencing. Put an led on one of the io pins through a 330 ohm resistor. Do an analogWrites to it at single increments, starting at 1, and see it the led only shows a brightness change on odd increments. As stated before this happens no matter what resolution, (analogWriteRange) you use.