For the following robotics programs, we used this design -- the so-called "five-minute bot". Instructions for its creation can be found at nxtprograms.com
First, we figured out how to make the robot move in a square shape. Here is a screenshot of the python code. The code instructed the robot to drive forward a certain distance, turn 90 degrees, and then repeat the process three more times. This causes the robot to move in a square shape.
Next, we figured out how to make the robot's sensors work. Here is a screenshot of that python code.
After that, we used our sensors to program a "scatterbot", or a robot that
Then, we designed and programmed a "Mars Rover", or a robot that
We altered the hardware so that the robot was more compact, because that made avoiding holes easier. Here is a picture of our design.
Here is a screenshot of the python code for the mars rover. It instructs the robot to drive forward until the color sensor senses blue or the sonar senses a hole. If the robot sense blue ("water"), then it displays "found water" on its screen, and then stops. If the sonar senses a hole, the robot backs up, turns around, and continues to drive forward.
Here is a picture of the fake mars surface we used for this exercise.
s