summaryrefslogtreecommitdiffstats
path: root/Matrix_5x6/Charlie/Charlie.pde
diff options
context:
space:
mode:
Diffstat (limited to 'Matrix_5x6/Charlie/Charlie.pde')
-rw-r--r--Matrix_5x6/Charlie/Charlie.pde47
1 files changed, 47 insertions, 0 deletions
diff --git a/Matrix_5x6/Charlie/Charlie.pde b/Matrix_5x6/Charlie/Charlie.pde
index fa7f4a0..32b1e83 100644
--- a/Matrix_5x6/Charlie/Charlie.pde
+++ b/Matrix_5x6/Charlie/Charlie.pde
@@ -1,5 +1,7 @@
#include <Charlieplex.h>
+#include "font.h"
+
/* TODO:
* Laufschrift
* Ameise
@@ -156,8 +158,53 @@ void schnecke(int s) {
}
}
+void shift_scr_left() {
+ int x, y;
+
+ for (x=0; x<5; x++)
+ for (y=0; y<5; y++)
+ scr[x][y] = scr[x+1][y];
+
+}
+
+void lauftext(char *text) {
+ byte c;
+ byte *f;
+ int x, y;
+ x = 5;
+ int i;
+
+ while (c = *(text++)) {
+
+ i = 6;
+ while (i--) {
+ if (c > 0x40 && c < 0x5B) {
+ f = &(font_chars[c-0x41][0]);
+ } else if (c >= 0x30 && c < 0x3A) {
+ f = &(font_numbers[c-0x20][0]);
+ } else if (c == ' ')
+ f = &(font_space[0][0]);
+
+ for (y=0; y<5; y++) {
+ scr[x][4-y] = (*(f+y)>>(i+1)&1) * 20;
+ }
+
+ drawscr(5);
+
+ if (x > 4) {
+ shift_scr_left();
+ } else
+ x++;
+ }
+
+ }
+
+
+}
+
void loop() {
// zufall_fading_up();
// zufall_fading_down();
+ lauftext("META MEUTE");
schnecke(random(4));
}