You mean the distance at which it changes from the drive forward to the turn left state? That would be this code:
if(ultrasonic2Distance > 0 && ultrasonic2Distance < 6) { // there's an object in front of usThat code is saying to go into the IF statement if the distance measured is 6. Making that number smaller means the robot will have to get closer to the object before branching, making the number larger means it will branch sooner.
Ah okay thanks, I tried increasing it but my robot still manages to flip himself sometimes, I think it's because of the angle he approaches the wall and the radius of the distance sensor only reading from the front. I have managed to implement the flashing LED and the stop sequence though so that's something! thanks ![]()




Find content
Not Telling
