feat: ajout start led on led lib #5

Merged
Clement merged 4 commits from feat/correction-libLed into master 2023-10-21 22:34:22 +00:00
Showing only changes of commit e60c966a97 - Show all commits

View File

@ -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);
}
}
}