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
Work with a partner. Both partners should do an equal amount
of work. Don't let one partner dominate.
Do not unplug any of the cables, including all sensors,
the serial cable or the power.
Do not set the wheel power higher than 7.
Do not let the robot fall off table, please.
Have fun.
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:
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.
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.
Compile and run your code. This will give you an introduction
to the IDE, the code, and communicating with the robot.
Add code to move the wheels.
Then add code to test one of the light sensors on the bottom.
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.
Your robot should wait until something is
within 10 inches of one of the RangeFinders.
Once it detects an object within 10 inches of a RangeFinder
start your robot moving forward.
Start counting black lines.......when your count gets to
3 stop your robot.
Hint: you will need to use a boolean flag so you don't count the same
black line twice. Set the black
flag to true once you notice a black line. Set the flag back to false
once a white line is noticed.
Advanced:
Make the robot play a different note every time a black line is crossed.
Have the robot play a song after the motors.
After stopping, have the robot wait for another signal to the IR
to start again.
While counting lines, if the IR detects a close object stop the robot
until the object is moved away.
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.