From 6319f57bd1f622aa61e73e172dec25150203ac84 Mon Sep 17 00:00:00 2001 From: cheapie Date: Fri, 29 May 2026 13:51:52 -0500 Subject: Add random-color display example --- c/randomcolor/randomcolor.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 c/randomcolor/randomcolor.c (limited to 'c/randomcolor/randomcolor.c') 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); + } +} -- cgit v1.2.3