Skip to content

Commit

Permalink
fix: add num leds
Browse files Browse the repository at this point in the history
  • Loading branch information
silvelo committed Jun 21, 2024
1 parent a8bc444 commit c9ce010
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions include/LedManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#define HOUR_PIN 17
#define NUM_PIXELS 28
#define SECOND_NUM_PIXELS 2
#define NUM_LEDS 2

class LedManager {
public:
Expand Down
10 changes: 6 additions & 4 deletions src/LedManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,13 @@ void LedManager::updateColorsFromPreferences() {
void LedManager::showHourDigit(int number, int startPixel, uint32_t color) {
for (int i = 0; i < 7; i++) {
if (hourSegments[number][i]) {
hoursStrip.setPixelColor(startPixel + (i * 2), color);
hoursStrip.setPixelColor(startPixel + (i * 2) + 1, color);
for(int j = 0; j < NUM_LEDS; j++){
hoursStrip.setPixelColor(startPixel + (i * NUM_LEDS) + j, color);
}
} else {
hoursStrip.setPixelColor(startPixel + (i * 2), hoursStrip.Color(0, 0, 0));
hoursStrip.setPixelColor(startPixel + (i * 2) + 1, hoursStrip.Color(0, 0, 0));
for(int j = 0; j < NUM_LEDS; j++){
hoursStrip.setPixelColor(startPixel + (i * NUM_LEDS) + j, hoursStrip.Color(0, 0, 0));
}
}
}
}
Expand Down

0 comments on commit c9ce010

Please sign in to comment.