summaryrefslogtreecommitdiffstats
path: root/blink.c
diff options
context:
space:
mode:
Diffstat (limited to 'blink.c')
-rw-r--r--blink.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/blink.c b/blink.c
new file mode 100644
index 0000000..7bf248f
--- /dev/null
+++ b/blink.c
@@ -0,0 +1,23 @@
+#include <util/delay.h>
+#include "libleds.h"
+
+static struct led_obj const PANEL = {0, 1<<7, 32, 8};
+static unsigned char const INTENSITY = 0x15;
+static unsigned int const DELAY_MS = 150;
+
+void led_main()
+{
+ struct led_color const colors[] = {
+ {INTENSITY, 0x00, 0x00},
+ {0x00, INTENSITY, 0x00},
+ {0x00, 0x00, INTENSITY},
+ };
+
+ unsigned char i = 0;
+
+ while (1) {
+ led_write_rgb_all(PANEL, colors[i]);
+ _delay_ms(DELAY_MS);
+ i = (i + 1) % (sizeof(colors) / sizeof(colors[0]));
+ }
+}