From e60c966a9715211bfe78edbbd8c555aa4bf6e2d0 Mon Sep 17 00:00:00 2001 From: Clement Date: Sun, 22 Oct 2023 00:08:01 +0200 Subject: [PATCH] fix led leb double lib issue --- lib/LedLib/scr/LedLib.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/LedLib/scr/LedLib.cpp b/lib/LedLib/scr/LedLib.cpp index af38569..2a9c9ed 100644 --- a/lib/LedLib/scr/LedLib.cpp +++ b/lib/LedLib/scr/LedLib.cpp @@ -26,7 +26,7 @@ void LedLib::actLed(int nb, int start){ // Boucle dans les LEDs // Loop in LEDs - for (int i = start; i < nb+start+1; i++) { + for (int i = start; i <= nb+start-1; i++) { int j = i; if(j > 24){ j -= 24; @@ -35,9 +35,9 @@ void LedLib::actLed(int nb, int start){ // Une LED sur deux est blanche : heure entière, l'autre rouge pour 30m // One LED out of two is white: whole hour, the other red for 30m if (j%2 == 0) { - this->strip->setPixelColor(j-1, 255, 0, 0); + this->strip->setPixelColor(j, 255, 255, 255); }else{ - this->strip->setPixelColor(j-1, 255, 255, 255); + this->strip->setPixelColor(j, 255, 0, 0); } } }