| |
OBJECTIVE
The objective of this lesson is to introduce the students to the
ROBOLAB programming language. They should start to develop the terminology
and basics of computer programming. This lesson should give them
a foundation for future programming for this unit. They will design
and test a simple program using ROBOLAB.
BACKGROUND FOR THE TEACHER
Robots are stupid! While a robot can be programmed to perform some
very sophisticated tasks even tasks a human cannot do, they can
only do what the human programming them tells them to do. Robots
will quite literally do only what they are told to do. Thus, it
is very important to learn how to effectively tell (program) your
Robot what to do.
ROBOLAB is a graphical programming software specifically designed
for the LEGO RCX programmable brick. The programmer uses icons to
develop programs that send commands to the RCX outputs (A, B, C)
and reads data from the RCX inputs (1, 2, 3). The ROBOLAB software
allows the user to design a program and then download it via an
infrared to the RCX programmable brick.
STANDARDS ADDRESSED
Standards for Technological Literacy (ITEA, 2002)
3-D. Technological systems often interact with each other
10-F. Troubleshooting is a problem solving method used to identify
the cause of a malfunction in a technological system.
17-H. Information and communication systems allow information to
be transferred from human to human, human to machine, and machine
to human.
MATERIALS
Computers: 1 per group
ROBOLAB v. 2.5.4 (installed on each computer)
USB Infrared Tower: 1 per group (included in LEGO Mindstorms kit)
Pre-built LEGO structure with motors and RCX (students should each
have one from previous lesson)
Icon color printouts
Masking Tape
SETUP
Before the class program your car with XYZ and ABC programs. Have
the icon printouts ready with a wall or board big enough to post
them to. Sample ABC and XYZ programs can be found in resources section.
Make sure the computers have ROBOLAB v. 2.5.4 loaded on them and
that the towers and RCXs communicate with each other.
GUIDING THE ACTIVITY
Ask the students:
“How are we going to tell your wheelchairs/structures what
to do?”
Yes, the computer.
“We are going to use a computer program called ROBOLAB to
program our wheelchairs to move.
ROBOLAB uses icons/pictures that we can string together to create
a program.
ICON INTRODUCTION
Introduce the different icons you have printed out. Have them try
and guess what each icon is for.
Begin—begins inventor program. Must be at the beginning
of every program. This icon tells the RCX to start here.
End—ends inventor program. Must be at the end of every
program. The begin and end icons must be in every program or else
the program will not be recognized by the RCX and will not run.
Motor A Forward—commands the RCX to power a motor connected
to output A to move forward. NOTE:
Forward may not always be forward in orientation to your car. You
may have to test whether forward or reverse will move the car forward.
Motor A Reverse—commands the RCX to power a motor connected
to output A to move in reverse. NOTE: Reverse may not always be
reverse in orientation to your car. You may have to test whether
forward or reverse will move your car in reverse.

Motor C Forward/Motor C Reverse—same as above, but
powers motor connected to output C. There are also motors for output
B.
Wait for 1 sec—tells the RCX to wait 1 sec before moving
on to the next operation. 
Similarly,
you can choose wait for commands for 2 sec, 4 sec, 6 sec, 8 sec,
10 sec, ? sec (which allows you to set any time including decimal
times)
Stop A—commands the RCX to stop sending power to output
A. Similarly, there are stop commands for outputs B and C.
Stop all Outputs—commands the RCX to stop sending power
to all outputs.
Sensors (do not cover these if you are not yet going to program
with them)
Wait for Brighter—tells the RCX to wait for a light
sensor reading that is brighter before moving on to the next operation.
Wait for Darker—tells the RCX to wait for a light sensor
reading that is darker before moving on to the next operation
Wait for Push—tells the RCX to wait for the touch sensor
to be pushed in before moving on to the next operation.
Wait for Let Go—tells the RCX to wait for the touch
sensor to be released before moving on to the next operation.
 
Input number—wired to the sensor command to tell the
RCX which input port (1, 2, or 3) the sensor is connected to.
CREATING “HUMAN” PROGRAM
(NOTE: During this exercise you will be using the programming icon
cards in your kit. You will tape the cards to the blackboard or
wall to create a program that a student or yourself will have to
act out as a robot would.)
“We are going to program a person to go from one point in
the classroom to another point. Where should we start? (Students
pick point in the room) Where should we end? (Students pick point
in the room… make sure the path includes some turns.)”
“Ok, what is the first thing we have to put on the board?”
Wait for students to say 
“Then what?”
Let the students construct an entire program that they think will
work. Have them work together arranging the icon printouts on the
board. Even if you know there are errors or it won’t work,
don’t correct them.
“What is the last thing that has to be in the program?”
Wait for students to say 
Go through (slowly) step-by-step having the human robot follow exactly
the commands.
Have them “troubleshoot” any errors that may have occurred
and redesign their program.
PROGRAMMING WITH THE COMPUTER
Have the groups find a computer to work with.
First have the students connect their USB or Serial tower to their
computer.
Guide them to open ROBOLAB
Click “Programmer”
Select “Inventor Level 3”
Go to “Window” menu at top of screen and click “Show
Tools Palette” and then “Show Functions Palette”
(Note: the Functions Palette may already be open)
If you have a projector or monitor that all the students can see
demonstrate constructing the following program. If you don’t
have construct this on the board with the laminated icons.

Showing how to place icons onto page and how to connect the icons
with wiring tool.
Show the students how to use the “Context Help” feature.
They can access this by pressing ctrl-h or by going to the “Help”
menu and selecting “Show Context Help.”
PROGRAMMING CHALLENGE
Present the students with the following programming challenge.
Challenge: Make a program that will have your car go forward past
a line (5-10ft away) and then travel in reverse past the starting
line and stop.
Example programs:

or
NOTE: The times will vary depending on the distance and the battery
power of RCX and power level of motor.
This
Wait for command lets you set any time.
When the students are ready to download their programs, direct their
attention to the download program arrow. Explain how when the arrow
is broken the program won’t be downloadable and when the arrow
is white the program is ready to download.
DISCUSSION
“What did you learn about programming with ROBOLAB today?”
“What kinds of things might you be able to do now that you
know how to program? What kinds of things could you do for your
final projects?”
END
|