diff --git a/Add-own-functionality.md b/Add-own-functionality.md index 923887e..daacd3d 100644 --- a/Add-own-functionality.md +++ b/Add-own-functionality.md @@ -27,8 +27,8 @@ After updating the color, you must call the `colorUpdated(int)` method. If you w ### Timing If you'd just like a simple modification that requires timing (like sending a request every 2 seconds), please **never** use the `delay()` function in your `userLoop()`! It will block everything else and WLED will become unresponsive and effects won't work! Instead, try this instead: -``` -long lastTime; +```cpp +long lastTime = 0; int delayMs = 2000; //we want to do something every 2 seconds void userLoop()