Use the IDE serial terminal to interact with the sketch.
String readString;
void setup() {
Serial.begin(74880); // 74880 Baud same as ESP8266 boot messages, so that boot messages are readable!
Serial.println("STRING echo"); // so I can see that the sketch is loaded
}
void loop() {
readString=""; // set the string to an empty string
while (Serial.available()) {
delay(3); //delay to allow buffer to fill
if (Serial.available() >0) {
char c = Serial.read(); //gets one byte from serial buffer
readString += c; //makes the string readString
}
}
if (readString.length() >0) {
Serial.println(readString); //see what was received
}
}