From 5492c562c47ed631c4ffb9f79465382488e451e8 Mon Sep 17 00:00:00 2001 From: daniel steuer Date: Mon, 17 Mar 2014 02:09:30 +0100 Subject: [PATCH] nicer intro animation --- rgbyteclock.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/rgbyteclock.c b/rgbyteclock.c index 84306e3..b14b69d 100644 --- a/rgbyteclock.c +++ b/rgbyteclock.c @@ -368,12 +368,34 @@ int8_t show_intro( uint32_t now, uint32_t animation_start ) { get_color( &r, &g, &b, tmp_sequence[i] ); led_set( i, r, g, b ); } + if( t_diff > 2400 ) { + step = 3; + } } - //led_set( index, r, g, b ); + // overwite step by step with button colors + if( !(t_diff % 100) && (step == 3) ) { + for( int i=0; i 2400 ) { + get_color( &r, &g, &b, colorScheme[1] ); + led_set( i+6, r, g, b ); + } + + if( t_diff > 3000 ) { + step = 4; + } + } + + if( step == 4) { + // blank top and bottom LED for symetry + led_set( 0, 0, 0, 0 ); + led_set( 6, 0, 0, 0 ); + } + + if( (now - animation_start) > 4000 ) { step = 0; return 1; }