The program below is for collision avoidance with the simple robot shown on the Dual InfraRed Proximity Detector page. This example is in written in RIS 1.0 code. There is also an example in RIS 2.0 code.
The first sensor watcher block (center of picture) causes the robot to turn away from an object on one side.
The second sensor watcher makes the robot go straight ahead if no objects are detected. If an object is detected straight ahead, the robot will back up, turn, then go straight ahead.
This program can produce interesting results when the sensor detects
a smaller object.