Now, add a loop in the middle of a program.
Try this:
1. Press CLEAR to delete the old program.
2. Enter the following sequence: FORWARD, LOOP, RIGHT,
LEFT, LOOP, LOOP, REVERSE.
3. Press TRANSMIT and Botley will execute the program.
You can use LOOP as many times as you’d like, as long as you
don’t exceed the maximum number of steps (80).
Object Detection & If/Then Programming
If/Then
programming is a way to teach robots how to behave
in certain conditions. We use
If/Then
behavior and logic all
the time. For example, IF it looks like rain outside, THEN we
might carry an umbrella. Robots can be programmed to use
sensors to interact with the world around them. Botley has an
object detection (OD) sensor that can help him “see” objects
in his path. Using this sensor is a great way to learn about
If/
Then
programming.
Try this (in CODE mode):
1. Place an object (such as a cup) about 10 inches directly
in front of Botley.
2. Press CLEAR to delete the old program.
3. Enter the following sequence: FORWARD, FORWARD,
FORWARD.
4. Press the OBJECT DETECTION
(OD) button. You’ll hear a sound
and the red light on the Remote
Programmer will stay lit to indicate
that the OD sensor is on. Next,
enter in what you would like
BOTLEY to do if he “sees” an
object in his path—try RIGHT, FORWARD, LEFT.
5. Press TRANSMIT.
Botley will execute the sequence.
IF
Botley “sees” an object
in his path,
THEN
he will perform the alternate sequence. He
will then fi nish the original sequence.
Note:
Botley’s OD sensor is between his eyes. He only detects
objects that are directly in front of him and at least 2" tall by
1 1⁄2" wide. If Botley isn’t “seeing” an object in front of him,
check the following:
• Is the POWER button on the bottom of Botley in the
CODE position?
• Is the OBJECT DETECTION sensor on (the red light on
the programmer should be lit)?
• Is the object too small?
• Is the object directly in front of Botley?
• Is the lighting too bright? Botley works best in ordinary
room lighting. His performance may be inconsistent in
very bright sunlight.
• Botley will not move forward when he “sees” an object.
He’ll just honk until you move the object out of his way.
Black Line Following
Botley has a special sensor underneath him that allows him
to follow a black line. You can also draw your own path for
Botley to follow. Use a white piece of paper and a thick black
marker. Hand-drawn lines must be between 4mm and 10mm
wide and solid black against white. Note that any dark pattern
or color change will aff ect his movements, so be sure there
are no other color or surface changes near the black line.
Draw something like this:
Botley will turn around and go back when he reaches the end
of the line.
Try this:
1. Slide the POWER switch
on the bottom of Botley
to LINE.
2. Place Botley on the black
line. The
sensor
on the
bottom of Botley needs
to be directly over the
black line.
Start Botley
here
4
2936 Botley Coding Robot GUD NBR4.indd 4
9/22/17 4:47 PM