I'm using two Arduinos to sent plain text strings to each other using newsoftserial and an RF transceiver.
Each string is perhaps 20-30 characters in length. How do I convert Serial.read()
into a string so I can do if x == "testing statements"
, etc.?
Unlimited string readed
String content = "";
char character;
while(Serial.available()) {
character = Serial.read();
content.concat(character);
}
if (content != "") {
Serial.println(content);
}