- Code: Select all
float fMaxSpeed = motor.getMoveMaxSpeed();
if(sonic.getDistance() < 30)
for (int i=0; i< 1; i++)
what my robot is doing is if the robot is near an object it will turn away from the object and move 30cm away from the object fire at the object, now what i wanted to know is that if the robot was more than 30cm away from the object to move towards the object until it reaches 30 cm from the object and then stop.
can any one just give me a little help cuz im really stuck