From 6a211a74f462bd03e55386b8c27190c188378394 Mon Sep 17 00:00:00 2001 From: Stefan Rupp Date: Thu, 7 Aug 2014 17:45:41 +0200 Subject: [PATCH] added HSV fading pattern --- rgbyteclock_patterns.c | 18 ++++++++++++++++++ rgbyteclock_patterns.h | 1 + 2 files changed, 19 insertions(+) diff --git a/rgbyteclock_patterns.c b/rgbyteclock_patterns.c index 11a133a..e86981b 100644 --- a/rgbyteclock_patterns.c +++ b/rgbyteclock_patterns.c @@ -165,6 +165,24 @@ void rgbyteclock_rounds_colored(void) } } + +void rgbyteclock_hsv_fading(void) +{ + + led_turn_all_on(); + + while (1) { + for ( uint16_t color = 0; color < 360; color+= 1 ) { + for ( uint8_t lednum = 0; lednum < 12; lednum++ ) { + led_set_hsv( lednum, (color + lednum * 20) % 360, 100, 100); + } + led_flush(); + timer_wait(5); + } + } + +} + void rgbyteclock_secwatch(void) { uint8_t hours, mins; diff --git a/rgbyteclock_patterns.h b/rgbyteclock_patterns.h index d81c442..f7511ac 100644 --- a/rgbyteclock_patterns.h +++ b/rgbyteclock_patterns.h @@ -22,6 +22,7 @@ void rgbyteclock_rounds(void); void rgbyteclock_rounds_colored(void); void rgbyteclock_rounds_white(void); +void rgbyteclock_hsv_fading(void); void rgbyteclock_secwatch(void); void rgbyteclock_secwatch_glide(void);