Hello, I'm new here, so please let me know if I do anything wrong!
I'm printing results of calculations in the serial monitor and I would like something to be printed only under certain condition. The calculation stops when a result is achieved, I have only 3 calculations. For example:
Calculation 1a: There are no result
Calculation 1b: The result is x
Calculation 2a: There are no result
Calculation 2b: There are no result
Calculation 2c: The result is y
Calculation 3a: There are no result
Calculation 3b: There are no result
Calculation 3c: There are no result
No results for 3
... and so on
The point is that if I have no result at all then "No results for (whatever the number)" will be printed.
Given that I can't know the result beforehand I can't write it in the code, hence my question: Is it possible to read the output in the serial monitor and react to it maybe something like:
if(Serial.read() == "c: There are no result"){
Serial.print("No results for ");
Serial.println(number);
}
I hope I'm clear enough. thank you for your help