diff options
Diffstat (limited to 'c/randomcolor/randomcolor.c')
| -rw-r--r-- | c/randomcolor/randomcolor.c | 34 |
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); + } +} |
