blob: d5d186e00005e362cd22f1a2dbea8e49c8220b1d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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);
}
}
|