How to Implement Offline Timer Control for a Cyclic Switch #850
-
Hi, First a big thank you to the Homespan team for their generous contributions I am currently designing a multi-channel HomeKit light but have encountered an issue with offline control. I want to establish an offline button functionality, meaning that users can use a physical button to control the light with a timer function even without a Wi-Fi connection. For example:
Currently, during testing, the physical button can turn the light on and off, but it does not turn off or on based on the timer. For quick testing, the cycle time is temporarily set to 3 seconds. Where is the error in my timer settings? How should I modify them so that the LED lights can turn on and off endlessly? Current development environment:
Here is my code Main sketch.ino
DEV_LED_W.h
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You've placed your timer logic in the |
Beta Was this translation helpful? Give feedback.
You've placed your timer logic in the
update()
portion of the code. This is incorrect - it should be in theloop()
portion of a Service. See Tutorial Example 14 - Emulated Pushbuttons for a complete example.