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 --- pulse.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 pulse.c (limited to 'pulse.c') diff --git a/pulse.c b/pulse.c new file mode 100644 index 0000000..d5d186e --- /dev/null +++ b/pulse.c @@ -0,0 +1,24 @@ +#include "libleds.h" + +static struct led_obj const PANEL = {0, 1<<7, 32, 8}; + +void update(int i) +{ + struct led_color const color = {i, i, i}; + led_write_rgb_all(PANEL, color); + led_latch(); +} + +void led_main() +{ + static int const STEP = 0x01; + static int const MIN = 0x00; + static int const MAX = 0xFF; + + while (1) { + for (int i = MIN; i < MAX; i += STEP) + update(i); + for (int i = MAX; i > MIN; i += STEP) + update(i); + } +} -- cgit v1.2.3