New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove analog flicker #678
Conversation
When adding an RGBW device to Alexa and then selecting a white color tone, Alexa will send CT values to the device. Having a warm white or cold white strip should use 100% of that strip and then add the RGB colors to get either a warmer color or a colder one.
Added IR remote with 40 keys to use with RGBW stripes.
...not implemented for ESP32 yet ESP32 Solid RGBW defines moved from env:esp32dev to env:esp32 ESP32 Solid RGBW defines
Update readme.md
To turn off IR remote use "0" in the settings, use 1 to 4 for different IR remote types.
adapt the logic to use CW and WW for different CT-values
Changed code from #define WLED_DISABLE_ANALOG_LEDS to #define WLED_USE_ANALOG_LEDS
NightLight used to brighten the light combined with fading from the actual (primary) color to the secondary color
RLYPIN definition dependant on WLED_USE_ANALOG_LEDS Corrected list-item indents (readme.md) updated to match upstream master (briLast in wled00.ino)
RLYPIN definition dependant on WLED_USE_ANALOG_LEDS Fixed headline and corrected list-item indents (readme.md) updated to match upstream master (briLast in wled00.ino)
run SetRgbwPwm from main loop and with GetPixelColor(0) to get all effects using fade_out() working.
Interesting. I was assuming the driving is happening via an interrupt handler on ESP8266 (and dedicated LEDC pwm driver on ESP32). Which would mean that after setting the duty cycle it should stay on that duty cycle until the Thank you though, I will merge this fix soon! |
Yes, you are right - funny - this had been in the code before - seems that nobody really used the 5CH code until now. I remember some comments in an issue and now it makes sense as this way 5CH output would never get used because none of the if statements became true. I will fix the source... |
for some reason Travis CI does not get a single compile okay. For all ESP8266 builds:
and for ESP32 builds:
I do not get any of this locally with PlatformIO (for both ESP32 and ESP8266) |
Yeah, I do not understand the origin of the Travis fail either. It definitely has nothing to do with the contents of your PR. Sorry to be so nitpicky this time, but |
Hi @Aircoookie, the change is okay - however: the flicker isn't gone 😢 I think that the change is good anyway, because this way we get the changes done through the NeoPixelBus library sent to the dumb LEDs, too. However, the flicker must have another reason: In my bedroom I#ve flashed Tasmota on exactly the same device / strip. I dig into this and look how tasmota did drive the LEDs. |
@Aircoookie @Def3nder
@Def3nder |
Hi @mike2nl, Here the details from the Information tab:
...it's quite old (like one year or so) and I did not touch it after that. Thx for the hint towards tasmota - I will get in touch with the named persons 😄 |
I got in contact with the Tasmota team as they had the same flicker on analog RGB LEDs. The phases of the different RGB channels become out-of-sync in certain situations and this leads to color-variation that is visable as flicker. I implemented the same approach here and yes: the flicker has gone away 😄 As the solution is done in one of the Arduino Core files, there is a PR (7057) open on the ESP8266/Arduino Library. |
So, I've tested the second solution, too: it has visable the same effect (flicker is more or less gone - it's exactl the same compared with the eyes only). However: looking at the osciloskope, hte later (PR7022) seems to be "better". I've posted my results here @Aircoookie: which solution do you like most ? |
Add this to platformio.ini
Add this to platformio.ini:
|
@Def3nder thank you for all that testing! Both these PRs seem to get the job done well at least visually, so I would tend towards using the fastest implementation. Out of interest, is the solution you implemented here more like 7022 or 7057? |
@Def3nder @Aircoookie |
Hi @Aircoookie, I implemented PR #7057 because PR #7022 caused reboots after 6 to 12 minutes when any form of light was on (no matter which color and no matter what brightness). I think this was an issue raised from calling analogWrite every 15ms, but this must not be a problem for a Arduino Core library ! So, I stick with PR#7057 which basically kept the phases total constant 😄 This had been the phases for red & green channel before: YouTube The author of PR#7057 did suggest to not call analogWrite if the values did not change, so I catched that idea and introduced two more variables I thought increasing / refreshing the PWM signals more often would help, but the problem did not have anything to do with that - so this "color-changed-check" will reduce loop-time. I think we can go with this solution - the Tasmota team did exactly the same. |
Hi @Aircoookie,
when using dumb (analog) LED strips there was a kind of flicker - especialy when using solid colors.
I found out that this is the case when
setPixelColor
isn't called frequently (and thus the analog PIN don't get updated).I change the code in that way that
setRgbwPwm
will be called from the main loop.This has two advantages:
fade_out()
or in general: all functions that change the strip appearance without callingsetPixelColor
.