kopia lustrzana https://github.com/Aircoookie/WLED
Updated Add own functionality (markdown)
rodzic
993b049ad8
commit
cbb561fe2d
|
@ -23,3 +23,20 @@ col[2] | byte (0-255) | Blue color value
|
||||||
white | byte (0-255) | White 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
Ładowanie…
Reference in New Issue