Updated Add own functionality (markdown)

This commit is contained in:
Aircoookie 2018-02-25 16:42:34 +01:00
parent 993b049ad8
commit cbb561fe2d
1 changed files with 18 additions and 1 deletions

View File

@ -22,4 +22,21 @@ col[1] | byte (0-255) | Green color value
col[2] | byte (0-255) | Blue color value
white | byte (0-255) | White color value
After updating the color, you must call the `colorUpdated(int)` method. If you want to send a notification with the new color to other ESPs, use `colorUpdated(1)`, otherwise `colorUpdated(5)`.
After updating the color, you must call the `colorUpdated(int)` method. If you want to send a notification with the new color to other ESPs, use `colorUpdated(1)`, otherwise `colorUpdated(5)`.
### 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;
int delayMs = 2000; //we want to do something every 2 seconds
void userLoop()
{
if (millis()-lastTime > delayMs)
{
lastTime = millis();
//do something you want to do every 2 seconds
}
}
```