A string that is coming from the serial port has te match a certain value.
But it never appears to be .
here you see my test script. Why does it not work whan i hive "hello" in the serial?
void setup() {
Serial.begin(115200);
}
void loop() {
if (Serial.available() > 0) {
String c = Serial.readString();
if (c == 'hallo') {
Serial.print("Good!");
} else {Serial.print("Bad!");
}}}
Thank you for your help, for the simulation below this helps.
For the actual application i try to make, not yet. My arduino is connected to a pc running this software
it send the serial code “9999\r” by plain ASCII. As a response tha arduino has to send a sting to identify itself. Once I could have it sent "9999" back (lost that code). since than i only get a timeout.
It is meant as a challenge but i haven't made it one step so far as i fail this simple communication protocol