From 68b5f182af145fdd9e62c9dde3eedcb9108f5ba4 Mon Sep 17 00:00:00 2001 From: Tobias Wiese Date: Mon, 3 May 2021 23:58:30 +0200 Subject: Initial commit Signed-off-by: Tobias Wiese --- blink.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 blink.c (limited to 'blink.c') 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 +#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])); + } +} -- cgit v1.2.3