From 4994c6a77dfddd6b64a7b3fceefaf15329810424 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?King=20K=C3=A9vin?= Date: Sun, 8 Oct 2017 18:35:57 +0200 Subject: [PATCH] application: better new hour animation --- application.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/application.c b/application.c index 8a0c8d8..f446df4 100644 --- a/application.c +++ b/application.c @@ -344,10 +344,26 @@ static void clock_animate_time(uint32_t time) */ static void clock_hours(void) { - for (uint16_t i=0; i<512; i++) { // fade in and out + for (uint16_t i=0; i<255; i++) { // fade out + for (uint16_t led=0; led255 ? 512-i-1 : i); // get fade brightness for (uint8_t hour=0; hour<12; hour++) { // set all hour colors - uint16_t led = LED_WS2812B_LEDS/12*hour; // get LED four hour mark + uint16_t led = LED_WS2812B_LEDS*hour/12; // get LED four hour mark clock_leds[led*3+0] = brightness; // set brightness clock_leds[led*3+1] = brightness; // set brightness clock_leds[led*3+2] = brightness; // set brightness