diff options
| author | Tobias Wiese <tobias@tobiaswiese.com> | 2021-05-03 23:58:30 +0200 |
|---|---|---|
| committer | Tobias Wiese <tobias@tobiaswiese.com> | 2021-07-22 02:26:29 +0200 |
| commit | 68b5f182af145fdd9e62c9dde3eedcb9108f5ba4 (patch) | |
| tree | 67c0011276b30f8f785b934be44044935f78bd73 /pulse.c | |
Signed-off-by: Tobias Wiese <tobias@tobiaswiese.com>
Diffstat (limited to 'pulse.c')
| -rw-r--r-- | pulse.c | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -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); + } +} |
