Lab 9: Robots!

Purpose

The purpose of this lab is to give you an introduction to using the robots that Hunter Lloyd showed us in class last week. To do this, you will need to use a new development environment, the RoboJDE. This lab will reinforce some of the concepts that we have previously learned such as the importance of using library classes and methods. The lab will also give you a flavor for embedded systems - a system where software is embedded in hardware.

Rules

Step One

First you will need to view the code from the lecture notes last week. Make sure you can follow along with what was done. You will need most of this code to complete this week's tasks. Here is a link to last week's lecture code.

The example programs cover the sensors and motors on the robot that you will need for this week's lab.

To Do:

  1. Open a new project on your drive: File->New Project. In the new project properties window fill in the project folder to be either your z: or thumb drive - the browse button is off to the right. Fill in the name of the Main Class with whatever you'd like.
  2. Create some code to write a simple line of output to each line of the two line LCD display. Hint: look at the example code.
  3. Compile and run your code. This will give you an introduction to the IDE, the code, and communicating with the robot.
  4. Add code to move the wheels.
  5. Then add code to test one of the light sensors on the bottom.
  6. Then add code to test an IR Range finder.

Part Two

To Do:

Now you will put all the code together to to solve a task.

Your robot should wait for a signal. Once it gets the signal your robot will traverse the paper you've been given and stop after it has crossed 3 black lines.

  1. Your robot should wait until something is within 10 inches of one of the RangeFinders.
  2. Once it detects an object within 10 inches of a RangeFinder start your robot moving forward.
  3. Start counting black lines.......when your count gets to 3 stop your robot.
  4. Advanced:

Here is a video of a robot doing a similar task, this one just prints out black or white when the transition is crossed:

Really advanced:

You won't have time, but if you do, attempt to get the UltraSound working. You'll need to find sample code on Ridgesoft.com.

Grading

You will receive full credit for attending this lab for the full time and trying to accomplish as many of the above activities as you can. As you leave the lab, ask your lab TA to write down your name so that you receive credit.