Hello everyone,
Im supposed to type "0" and then when the serial reads it, it should store the entire string that is coming after that 0 was entered.
I dont know what the size of this string is.
Here's my starter code:
String value;
if (Serial.available() && Serial.read() == '0') {
while (Serial.available() == 0) {
}
if (Serial.available() > 1 ) {
int h=Serial.available();
for (int i=0;i<h;i++){
value+=(char) Serial.read();
}
}
Serial.println(value);
value="";
The problem here is that it keeps looping in an infinite way and I dont know how else to put it. Maybe its a problem of setting the conditions right perhaps and i dont know how to do that..