This is a 3 Ping Sensor Array mounted on the Multiplo 3 Wheeled Robot. The brain is an EZB ver 3 board and the code is running from the EZ Builder PC Application.
The code base is from Rich Pyke's Ping Roam 1.2.0 Alpha EZ Builder FIle.
The code was edited by Dan Wakefield and Phillip Briski to remove the servo code for sweep and replace the after sweep ping values with the Ping values form the left, right, and middle Ping Sensors.
The goal was to get the robot to move through a hall or corridor and keep itself as close to the middle of the corridor as possible.
This was essentially achieved by allowing the "MoveLeft" and "MoveRIght" scripts to play off each other in "less than" values for the Right or Left Ping Sensors.
The Avoidance Script was highly edited to achieve the goal.
One main thing edited in the Avoidance script, was setting the $maxdistance value and creation of a $dontmove variable which would not allow the robot to move forward if the set value (can be adjusted in Start Script) of less than 15 was that of the middle Ping Sensor. This then allows the MoveRight and MoveLeft commands to turn towards the greater ping value from the left and right sensors.
Minor adjustments to sleep times were added to smooth turning and forward movement.