Jump to content


Photo

Increasing Ultrasonic Sensor Range?

RobotSensor Programming

  • Please log in to reply
No replies to this topic

#1 EinsteinMC

EinsteinMC

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 26 April 2015 - 07:54 PM

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) {}

  • 1




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users