fix led leb double lib issue

This commit is contained in:
Clement 2023-10-22 00:08:01 +02:00
parent 743ca41758
commit e60c966a97

View File

@ -26,7 +26,7 @@ void LedLib::actLed(int nb, int start){
// Boucle dans les LEDs // Boucle dans les LEDs
// Loop in 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; int j = i;
if(j > 24){ if(j > 24){
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 // 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 // One LED out of two is white: whole hour, the other red for 30m
if (j%2 == 0) { if (j%2 == 0) {
this->strip->setPixelColor(j-1, 255, 0, 0); this->strip->setPixelColor(j, 255, 255, 255);
}else{ }else{
this->strip->setPixelColor(j-1, 255, 255, 255); this->strip->setPixelColor(j, 255, 0, 0);
} }
} }
} }