void loop() {
parsing(); //loop the function
Serial.println(PCdata[0]);
Serial.println(PCdata[1]);
Serial.println(PCdata[2]);
Serial.println(PCdata[3]);
// Serial.println(PCdata[...........]);
delay(5000);
}
void parsing() {
while (Serial.available() > 0) {
//while there is data in serial buffer (128 bytes)
char aChar = Serial.read(); //aChar - current symbol in buffer
if (aChar != '$') {
//if aChar isnt the 'E' (End) symbol do:
inData[index1] = aChar;
//(inData - array, index - loop № counter) write all Buffer to the array
index1++; //index + 1 - loop count
inData[index1] = '\0';
//set the next position to '\0' or null symbol
} else {
//if aChar or current buffer symbol is 'E' (End) do:
char *p = inData; //create inData address pointer
char *str; //create pointer
index1 = 0; //set counter to 0
String value = ""; //create string
while ((str = strtok_r(p, ";", &p)) != NULL) { //???
string_convert = str; //???
//Serial.println(string_convert);
PCdata[index1] = string_convert.toInt(); //???
index1++; //counter + 1 - loop count
}
index1 = 0; //counter to 0
}
}
}