CS91 Building Robots
Lab Assignment--Week 4

This week we will focus on implementing some of the vehicles discussed by Braitenberg.

1. Secure a miniboard on your robot base. Be sure that you have easy access to the serial port connection, the download switch, and the reset button.

2. Attach two light sensors to your robot base; one on the left side and the other on the right side. There is generally less light near the floor, so you may want to try to point your sensors more towards the ceiling. Connect them to the miniboard.

3. In Braitenberg's vehicles, the sensors where directly connected to the motors through hardware. In our implementation we will instead use the Micro C software to link the sensors and the motors. Recall that the light sensors return values between 0 and 255 where low values indicate high light intensity. We must convert these light readings into motor speeds. Forward motor speeds range from 0 to 16, but the Lego motors are not very strong so speeds less than 8 will probably not move your robot.

Write Micro C programs for vehicles 2a, 2b, 3a, and 3c. Test them out on your robot base. You should test them under different light conditions (overhead light on/off, blinds open/closed, with flashlight, with floor light). Record the programs in your lab book, the behaviors exhibited by your robot, and discuss any problems you encounter with your base or with implementing the vehicles.

You may want to use some functions in your programs. The syntax for functions in Micro C is slightly different than for more modern C languages. All functions are assumed to return integers so no return type is needed.

function_name (variable1, variable2, ...)
type1 variable1;
type2 variable2;
...
{
statements
}