programmung question

void loop(){

digitalWrite(ledpin,HIGH);

while (Serial1.available())
{
speicher = Serial1.read();

if (speicher[i++] == 10) // überprüfung einer neuen Zeile ( == 10 ist wie '\n')
{
speicher[i-1] = '\0'; // Ende einer Zeile -> Ende des Strings
if (speicher[0] == '$' && speicher[1] == 'G' && speicher[2] == 'P' && speicher[3] == 'R' && speicher[4] == 'M' && speicher[5] == 'C')
{
if(speicher[18]=='A') // ist der status ok mach weiter (an 18ter Stelle steht ein "A")
{
String newStr=speicher; // make char to string
Serial.println(newStr);
do
{
commaPosition=newStr.indexOf(',').
if(commaPosition!=-1). // if there is a comma
{
Serial.println(newStr.substring(0,commaPosition)); //write text after first comma in substring and give it to serial port
newStr=newStr.substring(commaPosition+1,newStr.length()); // copy after. Comma till end of string in newstr
}}
while(commaPosition>=0);
delay(5000);

}
else
{
Serial.println("Wait for Valid signal...");
}
}
i=0; // Den Positionszeiger wieder auf den Anfang des Arrays setzen
}
}
}
In arduino cookbook at chapter 2.5 is a description about comma position if u dont understand my tags :))

Thx for interest :slight_smile: