I want it to be where if the string contains a certain character it would do one thing. For example if Serial.readString();
reads X100Y100 then I want to check if it contains an X or not. What I have so far is:
void serialEvent() {
serialData = Serial.readString();
if (serialData.indexOf('X')) {
serX.write(parseDataX(serialData));
} else {
// Doesnt contain the character X
}
}
Would this work?