Jump to content


EinsteinMC

Member Since 05 Mar 2015
Offline Last Active May 01 2015 09:20 PM
-----

#255 Increasing Ultrasonic Sensor Range?

Posted by EinsteinMC on 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