From 2fc64cbc442588dfb0763833cf8785e3cf81d132 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Sun, 6 Nov 2011 22:07:24 +0100 Subject: lauftext META MEUTE --- Matrix_5x6/Charlie/Charlie.pde | 47 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) (limited to 'Matrix_5x6/Charlie/Charlie.pde') 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 +#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)); } -- cgit v1.2.3