How can i modify the code in order to allow the sensor to detect an obstacle that is further away? Basically, I want the sensor to detect obstacles earlier and therefore have the robot respond earlier.
EDIT: Forget it, I got it. Had to increase the value in the if statement
if(ultrasonic2Distance > 20 || ultrasonic2Distance < 0) {}








