Test every n seconds plutot qu'un nombre de passe
This commit is contained in:
parent
c2fe8b118f
commit
a4c8fc3606
@ -140,13 +140,12 @@ void ledBlackAll()
|
||||
void ledCylon()
|
||||
{
|
||||
// Effet cylon : on allume une led, on attends, on eteinds, on passe à la suivante
|
||||
// TODO : trop d'attente entre les clients.loop !!!!
|
||||
for(int i = 0; i < LED_NUM; i++) {
|
||||
if ((i % 10) == 0) {
|
||||
client.loop();
|
||||
if (ledEffect != LED_EFFECT_CYLON) {
|
||||
return;
|
||||
}
|
||||
EVERY_N_SECONDS(1) {
|
||||
client.loop();
|
||||
if (ledEffect != LED_EFFECT_CYLON) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
leds[i] = color;
|
||||
@ -156,12 +155,13 @@ void ledCylon()
|
||||
FastLED.show();
|
||||
FastLED.delay(1000 / speed);
|
||||
}
|
||||
|
||||
for(int i = LED_NUM - 1; i > 0; i--) {
|
||||
if ((i % 10) == 0) {
|
||||
client.loop();
|
||||
if (ledEffect != LED_EFFECT_CYLON) {
|
||||
return;
|
||||
}
|
||||
EVERY_N_SECONDS(1) {
|
||||
client.loop();
|
||||
if (ledEffect != LED_EFFECT_CYLON) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
leds[i] = color;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user