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)
|
|
|
|
{
|
|
|
|
|
2014-03-12 21:12:16 +01:00
|
|
|
ledcontroller_turn_all_on();
|
|
|
|
|
2014-03-13 01:33:13 +01:00
|
|
|
while (1) {
|
|
|
|
|
|
|
|
//led_set(11, 0x7ff, 0x00, 0x00);
|
|
|
|
for (int c=0; c<48; c++) {
|
|
|
|
//PORTC ^= (1<<PC5);
|
|
|
|
ledcontroller_set_channel(c, 0x7ff);
|
|
|
|
led_flush();
|
|
|
|
timer_wait(1000);
|
|
|
|
}
|
|
|
|
for (int i=0; i<16; i++) {
|
|
|
|
led_set(i, 0x00, 0x00, 0x00);
|
|
|
|
}
|
|
|
|
led_flush();
|
|
|
|
timer_wait(100);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
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-13 01:33:13 +01:00
|
|
|
timer_wait(500);
|
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-13 01:33:13 +01:00
|
|
|
timer_wait(100);
|
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-13 01:33:13 +01:00
|
|
|
timer_wait(500);
|
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-13 01:33:13 +01:00
|
|
|
timer_wait(100);
|
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-13 01:33:13 +01:00
|
|
|
timer_wait(500);
|
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-13 01:33:13 +01:00
|
|
|
timer_wait(100);
|
2014-03-01 03:50:09 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|