diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp index 4f18fe3..5aecda2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -166,10 +166,21 @@ void play_animation(uint8_t *animation, int animation_size, int segment_delay) { // Check the time, and display it on the clock void update_clock() { + // Set hue to a value derived from the time of day, doing 1 loop per day + int hour = CopenhagenTime.dateTime("G").toInt(); + int minute = CopenhagenTime.dateTime("i").toInt(); + int minute_of_day = (hour * 60) + minute; + hue = map(minute_of_day, 0, 1440, 0, 255); + + Serial.println("Minute of day:"); + Serial.println(minute_of_day); + Serial.println("Hue:"); + Serial.println(hue); + // Format the time as a 4-digit integer int timeInt = CopenhagenTime.dateTime("Hi").toInt(); // Sadly string format display_number(timeInt); - hue++; // Increment HSV hue + //hue++; // Increment HSV hue } void setup() { @@ -178,7 +189,7 @@ void setup() { FastLED.addLeds<NEOPIXEL, LED_PIN>(leds, LED_COUNT); // GRB ordering is assumed // Turn off all LEDs - FastLED.clear(); + FastLED.clear(); Serial.begin(9600); |
