rgbyteclock-code/rgbyteclock.c

61 lines
1.3 KiB
C
Raw Normal View History

2014-03-01 03:50:09 +01:00
2014-03-01 03:54:52 +01:00
/*
* ----------------------------------------------------------------------------
* "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
* ----------------------------------------------------------------------------
*/
2014-03-01 03:50:09 +01:00
#include "rgbyteclock.h"
2014-03-03 05:01:36 +01:00
#include "timer.h"
#include "lcd.h"
#include "ledcontroller.h"
2014-03-01 03:50:09 +01:00
void rgbyteclock(void)
{
while(1) {
2014-03-12 17:07:18 +01:00
PORTC ^= (1<<PC5);
2014-03-03 05:01:36 +01:00
for (int i=0; i<15; i++) {
led_set(i, 0x7ff, 0x00, 0x00);
led_flush();
2014-03-12 17:07:18 +01:00
timer_wait(2000);
2014-03-03 05:01:36 +01:00
}
for (int i=0; i<15; i++) {
led_set(i, 0x00, 0x00, 0x00);
}
led_flush();
2014-03-12 17:07:18 +01:00
timer_wait(1000);
2014-03-03 05:01:36 +01:00
for (int i=0; i<15; i++) {
led_set(i, 0x00, 0x7ff, 0x00);
led_flush();
2014-03-12 17:07:18 +01:00
timer_wait(2000);
2014-03-03 05:01:36 +01:00
}
for (int i=0; i<15; i++) {
led_set(i, 0x00, 0x00, 0x00);
}
led_flush();
2014-03-12 17:07:18 +01:00
timer_wait(1000);
2014-03-03 05:01:36 +01:00
for (int i=0; i<15; i++) {
led_set(i, 0x00, 0x00, 0x7ff);
led_flush();
2014-03-12 17:07:18 +01:00
timer_wait(2000);
2014-03-03 05:01:36 +01:00
}
for (int i=0; i<15; i++) {
led_set(i, 0x00, 0x00, 0x00);
}
led_flush();
2014-03-12 17:07:18 +01:00
timer_wait(1000);
2014-03-01 03:50:09 +01:00
}
}