Squaring Up with Lines
Sometimes in FLL the robot goes off course. To prevent that, we can align it up with a line. To do this, you need 2 color or light sensors on the robot. The basic idea is to move the robot forward until one sensor sees the line, then turn until both sensors sense the line.
Squaring Up with Walls-Passive or No sensors
Sometimes, a robot will do its task bot while doing it, it goes off track. To help avoid this, we can square it with a wall. The idea is to back up the robot for a certain amount of time so that it is nearly squared up. The process is then repeated a few times to ensure accuracy. This program works only if your robot has a straight back or else the robot will not be in line with the wall.
Squaring Up with Walls- using Ultrasonic Sensor
The ultrasonic sensor can be used to help slow down or stop the robot as it nears the wall. This method is time efficient since the ultrasonic sensor will tell the robot when to stop. The robot should also have a straight back since the ultrasonic sensor is helping the robot, not doing the squaring.
Squaring Up with Walls- using 1/2 touch sensor(s)
Using touch sensors is probably the best way to square up with a wall if your robot has 1/2 open sensor ports. With touch sensors, the robot back doesn't have to be flat. The best way is to use 2 touch sensors because the touch sensors automatically align the robot and tell it when to stop.