Add just before the last curly brace
else {
//lost: What to do now ???
digitalWrite(motorLEFTpin1,LOW);
digitalWrite(motorLEFTpin2,LOW);
digitalWrite(motorRIGHTpin1,LOW);
digitalWrite(motorRIGHTpin2,LOW);
}
... and you robot will stop ...
the rest is up to you ![]()