diff --git a/ledcontroller.c b/ledcontroller.c index 98d98fb..c606da5 100644 --- a/ledcontroller.c +++ b/ledcontroller.c @@ -87,6 +87,26 @@ static void write_global_latch(uint16_t data) } +void ledcontroller_turn_all_on(void) +{ + + write_data(0xffff, 2); + write_data(0xffff, 2); + write_data(0xffff, 2); + +} + + +void ledcontroller_turn_all_off(void) +{ + + write_data(0xffff, 2); + write_data(0xffff, 2); + write_data(0xffff, 2); + +} + + void ledcontroller_init(void) { diff --git a/ledcontroller.h b/ledcontroller.h index e7f6eb1..af5a5d3 100644 --- a/ledcontroller.h +++ b/ledcontroller.h @@ -21,7 +21,8 @@ void ledcontroller_init(void); void led_set(uint8_t lednum, uint16_t red, uint16_t green, uint16_t blue); void led_flush(void); - +void ledcontroller_turn_all_on(void); +void ledcontroller_turn_all_off(void); #endif // LEDCONTROLLER_H diff --git a/rgbyteclock.c b/rgbyteclock.c index efe43fd..2460184 100644 --- a/rgbyteclock.c +++ b/rgbyteclock.c @@ -20,6 +20,8 @@ void rgbyteclock(void) { + ledcontroller_turn_all_on(); + while(1) { PORTC ^= (1<