Fix for #3955: added a delay after switching relay#4474
Conversation
- helps to stabilize power on the LEDs before sending data
There was a problem hiding this comment.
Looks OK to me.
@DedeHai did you check that the delay is only happening once when the relay actually gets switched?
The relay handling code is very old (=hard to read) - a repeated digitalWrite of the same value would not be noticeable, however a repeated delay might hurt ...
|
the code is only executed once when exiting |
|
👍 |
|
@DedeHai on a second look - do you think that the same delay should also be added at startup when initially controlling the relay? If yes, then maybe this location should also be changed: WLED::beginStrip() runs once at startup, long before handleIO() gets called for the first time. Just a random after-merge thought. Could be I'm just not involved at discord so I missed something important 🤷♂️ ... |
- helps to stabilize power on the LEDs before sending data
|
I thought about that too, but I have noticed recently, that there may be a bug in that part of the code and I wanted to take a closer look at: I did notice in a test, that the relay did not always switch to on depending on config settings and preset settings. |
- helps to stabilize power on the LEDs before sending data
helps to stabilize power on the LEDs before sending data