summaryrefslogtreecommitdiff
path: root/c/randomcolor/randomcolor.c
diff options
context:
space:
mode:
authorcheapie <cheapiephp@gmail.com>2026-05-29 13:51:52 -0500
committercheapie <cheapiephp@gmail.com>2026-05-29 13:51:52 -0500
commit6319f57bd1f622aa61e73e172dec25150203ac84 (patch)
treebdd007a7191a501ebce7c6883061c0e6fec11d36 /c/randomcolor/randomcolor.c
parent8ae725e76f5032ea216673a87a43b5e3ba8358d6 (diff)
downloadrvcontroller-6319f57bd1f622aa61e73e172dec25150203ac84.tar
rvcontroller-6319f57bd1f622aa61e73e172dec25150203ac84.tar.gz
rvcontroller-6319f57bd1f622aa61e73e172dec25150203ac84.tar.bz2
rvcontroller-6319f57bd1f622aa61e73e172dec25150203ac84.tar.xz
rvcontroller-6319f57bd1f622aa61e73e172dec25150203ac84.zip
Add random-color display example
Diffstat (limited to 'c/randomcolor/randomcolor.c')
-rw-r--r--c/randomcolor/randomcolor.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/c/randomcolor/randomcolor.c b/c/randomcolor/randomcolor.c
new file mode 100644
index 0000000..9afe79b
--- /dev/null
+++ b/c/randomcolor/randomcolor.c
@@ -0,0 +1,34 @@
+/* Random Color Display for RVController
+ * A product of Advanced Mesecons Devices, a Cheapie Systems company
+ * This is free and unencumbered software released into the public domain.
+ * See http://unlicense.org/ for more information */
+
+#include "rvcontroller-ecalls.h"
+
+char color[] = "123456";
+char channel[] = "A1";
+char chars[] = "0123456789ABCDEF";
+
+void randomize() {
+ for (int i=0;i<=5;i++) {
+ color[i] = chars[randomint(0,15)];
+ }
+}
+
+void main(void) {
+ for (int y=0;y<=5;y++) {
+ channel[1] = '1' + y;
+ for (int x=0;x<=19;x++) {
+ channel[0] = 'A' + x;
+ randomize();
+ digiline_send(channel,color);
+ }
+ }
+
+ for (;;) {
+ channel[0] = randomint('A','T');
+ channel[1] = randomint('1','6');
+ randomize();
+ digiline_send(channel,color);
+ }
+}