Oops, day start logic

This commit is contained in:
Neale Pickett 2023-01-09 07:19:55 -07:00
parent d16613cb5d
commit 1681139205
2 changed files with 6 additions and 15 deletions

View File

@ -64,6 +64,7 @@ I suggest you set it to standard time and pretend it's in sync with the sun.
* Each pixel in the bottom row is 25 seconds * Each pixel in the bottom row is 25 seconds
* There are four pixels around the bottom that move every 5 seconds * There are four pixels around the bottom that move every 5 seconds
Philosophy Philosophy
---------- ----------
@ -83,4 +84,3 @@ but if you want to make NeoPixel art,
think hard about what the end result should look like. think hard about what the end result should look like.
It's not enough to make a cool light show; It's not enough to make a cool light show;
it has to make people wonder "what is that for?" it has to make people wonder "what is that for?"

View File

@ -267,10 +267,10 @@ void displayTime(unsigned long duration = 20 * SECOND) {
// Outer: 5s // Outer: 5s
uint8_t s = (mmss/5) % 5; uint8_t s = (mmss/5) % 5;
grid[64 - 7 - 1] = CHSV(HUE_PURPLE, 64, (s==1)?64:0); grid[64 - 7 - 1] = CHSV(HUE_PURPLE, 128, (s==1)?96:0);
grid[64 - 15 - 1] = CHSV(HUE_PURPLE, 64, (s==2)?64:0); grid[64 - 15 - 1] = CHSV(HUE_PURPLE, 128, (s==2)?96:0);
grid[64 - 8 - 1] = CHSV(HUE_PURPLE, 64, (s==3)?64:0); grid[64 - 8 - 1] = CHSV(HUE_PURPLE, 128, (s==3)?96:0);
grid[64 - 0 - 1] = CHSV(HUE_PURPLE, 64, (s==4)?64:0); grid[64 - 0 - 1] = CHSV(HUE_PURPLE, 128, (s==4)?96:0);
for (int i = 0; i < 12; i++) { for (int i = 0; i < 12; i++) {
// Omit first and last position on a row // Omit first and last position on a row
@ -289,15 +289,6 @@ void displayTime(unsigned long duration = 20 * SECOND) {
} }
} }
void adjustBrightness() {
int hh = timeClient.getHours();
if ((hh >= DAY_BEGIN) && (hh < DAY_END)) {
FastLED.setBrightness(DAY_BRIGHTNESS);
} else {
FastLED.setBrightness(NIGHT_BRIGHTNESS);
}
}
void loop() { void loop() {
Picker p; Picker p;
uint8_t getprob = 4; uint8_t getprob = 4;
@ -307,7 +298,7 @@ void loop() {
timeClient.update(); timeClient.update();
if (timeClient.isTimeSet()) { if (timeClient.isTimeSet()) {
int hh = timeClient.getHours(); int hh = timeClient.getHours();
day = ((hh > DAY_BEGIN) && (hh < DAY_END)); day = ((hh >= DAY_BEGIN) && (hh < DAY_END));
} }
FastLED.setBrightness(day?DAY_BRIGHTNESS:NIGHT_BRIGHTNESS); FastLED.setBrightness(day?DAY_BRIGHTNESS:NIGHT_BRIGHTNESS);