-
Notifications
You must be signed in to change notification settings - Fork 75
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
Add pulse mode #28
base: master
Are you sure you want to change the base?
Add pulse mode #28
Conversation
|
||
if (pulse) { | ||
if ( millis() % pulseTickEveryXms == 0) { | ||
pulseCurrentBrightness += pulseDir; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I'm misunderstanding something here, but wouldn't this only trigger if we manage to hit this if
in a matching millisecond? I don't think we can guarantee that the loop will happen regularly enough to trust that.
I'll give this a more thorough review in the next few days.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point.. my tests (on a WeMos D1 mini with 80MHz) showed that without the delay(1)
the pulsing was way too fast, and with it, one cycle was around 5 seconds (like specified in the config) and the animation looked nice and smooth.
Will look into a possibility to refactor this.
Can you clarify what exactly the pulse mode does? |
the difference between this pulse and the flash effect seems to be that the flash only flashes a specified amount of times while this pulse would keep on flashing until stopped. This could be implemented in the flash effect using 0 as flash length or by adding another option to start it indefinitely. I'm not sure if and how you could pass effect parameters in HA however. |
Flash does 0-255-0-255-0 in a specified interval |
So do we also need a flash effect that pulses indefinitely? |
TODO: adapt to the new unified sketch |
Pulse mode transitions forth and back between black and the current color.
Looking for remarks before possibly adapting it for the other 2 sketches.