Hallo an alle
mein Name ist Claus und ich habe als kleiner Junge mal RFT gelernt.
Nun im gesetzten alter beschäftige ich mich wieder mit der Elektronik.
Das Arduino System ist da für mich der ideale einstig.
Nur habe ich ab und zu mal ein paar Probleme die ich nicht alleine lösen kann.
Ich hoffe Ihr könnt mir dabei helfen.

Ich habe mir ein Lauflicht von Adafruit ( LED Matrix 16X32 ) gekauft und habe es auch Problemlos
Zum laufen bekommen.

Nun versuche ich über die Serielle Schnittstelle Daten an das Display zu senden.
Das Funktioniert auch, nur kann ich zwar mehr als 10 Zeichen senden, das Display zeigt immer
nur max 10 Zeichen an .

Bsp.

Ich sende „ 123456789012345“
Serial.print der eingehenden Zeichen zeigt alle Zeichen an.
Nur die Variable „Text“ enthält nur 10 Zeichen "1234567890".
Ich komme nicht dahinter warum das so ist.

Ich hoffe jemand kann mir sagen was ich falsch mache.

Danke


// scrolltext demo for Adafruit RGBmatrixPanel library.
// Demonstrates double-buffered animation on our 16x32 RGB LED matrix:
// http://www.adafruit.com/products/420

// Written by Limor Fried/Ladyada & Phil Burgess/PaintYourDragon
// for Adafruit Industries.
// BSD license, all text above must be included in any redistribution.

#include <Adafruit_GFX.h> // Core graphics library
#include <RGBmatrixPanel.h> // Hardware-specific library

// Similar to F(), but for PROGMEM string pointers rather than literals
//#define F2(progmem_ptr) (const __FlashStringHelper *)progmem_ptr

#define CLK 8 // MUST be on PORTB! (Use pin 11 on Mega)
#define LAT A3
#define OE 9
#define A A0
#define B A1
#define C A2
// Last parameter = 'true' enables double-buffering, for flicker-free,
// buttery smooth animation. Note that NOTHING WILL SHOW ON THE DISPLAY
// until the first call to swapBuffers(). This is normal.
RGBmatrixPanel matrix(A, B, C, CLK, LAT, OE, true);
// Double-buffered mode consumes nearly all the RAM available on the
// Arduino Uno -- only a handful of free bytes remain. Even the


String Text; // a string to hold incoming data
boolean stringComplete = false; // whether the string is complete
int textMin;
int l = 0;
int textX = matrix.width();

void setup()
{
Serial.begin(9600);
Text.reserve(200);
matrix.begin();
matrix.setTextWrap(false); // Allow text to run off right edge
matrix.setTextSize(1);
}

void loop() {

if (stringComplete)
{
Serial.println(Text);
Serial.println(l);
textMin = l * -8,
stringComplete = false;
}

matrix.fillScreen(0);
matrix.setTextColor(matrix.Color333(0, 0, 1));
matrix.fillRect(0, 14, 32, 2, matrix.Color333(1, 0, 0));
matrix.fillRect(0, 0, 32, 2, matrix.Color333(1, 0, 0));

if (l >= 7)
{
if((--textX) < textMin) textX = matrix.width();
delay(30);
matrix.setCursor(textX, 4);
matrix.print(Text);
}
else
{
matrix.setCursor(1, 4);
matrix.print(Text);
}

matrix.swapBuffers(false);

}

void serialEvent()
{
Text = "";
l = 0 ;
while (Serial.available())
{
char inChar = (char)Serial.read();
Text += inChar;
delay(3);
Serial.print(inChar);
Serial.println();
l ++;
if (inChar == '\n')
{
stringComplete = true;
}
}
}