summaryrefslogtreecommitdiffstats
path: root/pulse.c
diff options
context:
space:
mode:
Diffstat (limited to 'pulse.c')
-rw-r--r--pulse.c24
1 files changed, 24 insertions, 0 deletions
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);
+ }
+}