Benziner:
Guten Morgen
Nun werden die nachkomma nicht mehr angezeigt, bei ereichen von vorkomma 100 springt es auch brav in "over" und wird sauber angezeigt.
Ja, da war wohl auch bei mir gestern spät.
Der Puffer wird ja weiter beschrieben, das führt dann zu eigenartigen Effekten.
Ich hab das mal verucht auf eine andere Art zulösen.
Zum Einen wird die RZ jetzt geschrieben, wenn "RZ1" erkannt.
Die gesamte Ausgabe der RZen ist jetzt ausgelagert.
Zum Anderen übergebe ich an over() jetzt ein byte. 0 heisst, das die Laufschrift abgeschaltet wird, 1 macht sie an und jede andere sorgt nur dafür, das die Laufschrift läuft.
Die entscheidenen Zeilen:
static bool anaus=false;
if (x==0) anaus=false;
if (x==1) anaus=true;
if (anaus==false) return;
Im loop() wird mit over(2) nur dafür gesorgt, das nachgesehen wird, ob die Laufschrift aktiv ist und dann ggfls. weiterläuft.
So zumindest die Theorie.
Was die Warnung bei if ( letter < tape.length() ) { angeht.. Hm. die Codezeile hab ich so bekommen 
Hier in complett...
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Max72xxPanel.h>
const byte pinCS = 10; // Attach CS=10, DIN=11,CLK=13
const byte numberOfHorizontalDisplays = 4;
const byte numberOfVerticalDisplays = 1;
Max72xxPanel matrix = Max72xxPanel(pinCS, numberOfHorizontalDisplays, numberOfVerticalDisplays);
String tape = "Du must schon Gas geben, sonst wird das nichts !";
int spacer = 1;
int width = 5 + spacer; // The font width is 5 pixels
void setup() {
matrix.setIntensity(2); // Use a value between 0 and 15 for brightness
matrix.setRotation(0, 1); // The first display is position upside down
matrix.setRotation(1, 1); // The first display is position upside down
matrix.setRotation(2, 1); // The first display is position upside down
matrix.setRotation(3, 1); // The first display is position upside down
matrix.setCursor(1, 0);
matrix.print("-----");
matrix.write();
delay(1000);
Serial.begin(115200);
}
void loop() {
const byte numChars = 40;
static char buf[numChars];
static uint16_t ndx = 0;
char rc;
while (Serial.available() > 0) {
rc = Serial.read();
if (rc == ';') {
buf[ndx] = '\0';
ndx = 0;
auswertungZeiten(buf);
}
else {
buf[ndx] = rc;
ndx = (1 + ndx) % numChars;
}
}
over(2);
}
void auswertungZeiten(char * buf1) {
static unsigned int vorkomma = 0;
static unsigned int nachkomma = 0;
char * bez = strtok(buf1, ":");
char * inh = strtok(NULL, ":");
char buf2[8];
if (!strncmp(bez, "RZ1", 3)) {
sscanf(inh, "%i,%s", &vorkomma, buf2);
nachkomma = atoi(buf2);
matrix.setTextSize(0);
ausgabeRZ(vorkomma, nachkomma);
}
if (vorkomma > 99) { //overload
over(1);
}
else over(0);
}
void ausgabeRZ(const int vk, const int nk)
{
matrix.fillScreen(LOW);
if (vk < 10) {
matrix.setCursor(6, 0);
} else {
matrix.setCursor(0, 0);
}
matrix.print(vk);
matrix.drawPixel(12, 6, HIGH);
matrix.drawPixel(12, 7, HIGH);
matrix.setCursor(14, 0);
if (nk < 100) {
matrix.print("0");
}
if (nk < 10) {
matrix.print("0");
}
matrix.print(nk);
matrix.write();
}
void over(byte x) { // x=0 aus, 1=ein, 2=aktuallisieren
static unsigned long lastmillis = millis();
const unsigned long schrittTime = 200;
static unsigned int i = 0;
static bool anaus=false;
if (x==0) anaus=false;
if (x==1) anaus=true;
if (anaus==false) return;
if (millis() - lastmillis > schrittTime)
{
lastmillis = millis();
if (i < width * tape.length() + matrix.width() - 1 - spacer)
{
i++;
}
else
{
i = 0;
}
matrix.fillScreen(LOW);
int letter = i / width;
int x = (matrix.width() - 1) - i % width;
int y = (matrix.height() - 8) / 2;
while ( x + width - spacer >= 0 && letter >= 0 ) {
if ( letter < tape.length() ) {
matrix.drawChar(x, y, tape[letter], HIGH, LOW, 1);
}
letter--;
x -= width;
}
matrix.write();
}
}
;( Offensichtlich hat agmue eine gleichlautende Idee gehabt.
Na mal sehen, heute Abend komm ich weider an eine portable, dann schmeiss ich mir erstmal die lib rauf...