rgbyteclock-code/rgbyteclock.c

63 lines
1.3 KiB
C

/*
* ----------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42):
* <struppi@struppi.name> wrote this file. As long as you retain this notice you
* can do whatever you want with this stuff. If we meet some day, and you think
* this stuff is worth it, you can buy me a beer in return.
* (c) 2014 Stefan Rupp
* ----------------------------------------------------------------------------
*/
#include "rgbyteclock.h"
#include "timer.h"
#include "lcd.h"
#include "ledcontroller.h"
void rgbyteclock(void)
{
ledcontroller_turn_all_on();
while (1) {
PORTC ^= (1<<PC5);
for (int i=0; i<15; i++) {
led_set(i, 0x7ff, 0x00, 0x00);
led_flush();
timer_wait(500);
}
for (int i=0; i<15; i++) {
led_set(i, 0x00, 0x00, 0x00);
}
led_flush();
timer_wait(100);
for (int i=0; i<15; i++) {
led_set(i, 0x00, 0x7ff, 0x00);
led_flush();
timer_wait(500);
}
for (int i=0; i<15; i++) {
led_set(i, 0x00, 0x00, 0x00);
}
led_flush();
timer_wait(100);
for (int i=0; i<15; i++) {
led_set(i, 0x00, 0x00, 0x7ff);
led_flush();
timer_wait(500);
}
for (int i=0; i<15; i++) {
led_set(i, 0x00, 0x00, 0x00);
}
led_flush();
timer_wait(100);
}
}