Robotics

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

  1. Constantly drives
  2. Turns around when the sonar detects an object within a certain distance.
  3. Stops when the touch sensor is pressed.
Here is the screenshot of the python code for the scatterbot.

Then, we designed and programmed a "Mars Rover", or a robot that

  1. Avoids falling into "craters" and off the edges of things
  2. Turns around when it senses green.
  3. Stops when it senses "water" (blue) and displays the message "found water' on the screen.

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.

Back to index.

s