summaryrefslogtreecommitdiffstats
path: root/test.c
diff options
context:
space:
mode:
authorTobias Wiese <tobias@tobiaswiese.com>2021-05-03 23:58:30 +0200
committerTobias Wiese <tobias@tobiaswiese.com>2021-07-22 02:26:29 +0200
commit68b5f182af145fdd9e62c9dde3eedcb9108f5ba4 (patch)
tree67c0011276b30f8f785b934be44044935f78bd73 /test.c
Initial commitHEADmaster
Signed-off-by: Tobias Wiese <tobias@tobiaswiese.com>
Diffstat (limited to 'test.c')
-rw-r--r--test.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/test.c b/test.c
new file mode 100644
index 0000000..176223f
--- /dev/null
+++ b/test.c
@@ -0,0 +1,22 @@
+#include "libleds.h"
+
+static struct led_obj const PANEL = {0, 1<<7, 32, 8};
+static unsigned char const INTENSITY = 0x01;
+
+void led_main()
+{
+ struct led_color const colors[] = {
+ {0x0000000, 0x0000000, 0x0000000},
+ {INTENSITY, 0x0000000, 0x0000000},
+ {0x0000000, INTENSITY, 0x0000000},
+ {INTENSITY, INTENSITY, 0x0000000},
+ {0x0000000, 0x0000000, INTENSITY},
+ {INTENSITY, 0x0000000, INTENSITY},
+ {0x0000000, INTENSITY, INTENSITY},
+ {INTENSITY, INTENSITY, INTENSITY},
+ };
+
+ for(int x = 0; x < PANEL.width; x++)
+ for (int i = 0; i < (sizeof(colors) / sizeof(colors[0])); i++)
+ led_write_rgb(PANEL.port, PANEL.pins, colors[i]);
+}