Test every n seconds plutot qu'un nombre de passe

This commit is contained in:
Julien Cabillot 2017-03-06 13:42:43 +01:00 committed by JC
parent c2fe8b118f
commit a4c8fc3606

View File

@ -140,9 +140,8 @@ 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) {
EVERY_N_SECONDS(1) {
client.loop();
if (ledEffect != LED_EFFECT_CYLON) {
return;
@ -156,8 +155,9 @@ void ledCylon()
FastLED.show();
FastLED.delay(1000 / speed);
}
for(int i = LED_NUM - 1; i > 0; i--) {
if ((i % 10) == 0) {
EVERY_N_SECONDS(1) {
client.loop();
if (ledEffect != LED_EFFECT_CYLON) {
return;