sparkfun micro:bot Kit Experiment Manual page 78

Table of Contents

Advertisement

On Button A, On Button B and On Button A+B
In this example we use the
without messy
statements.
if
In this program the
On Button A
as a comparison value and also sets the servo positions to 90 degrees.
The
block is used to set servo position to 45 degrees.
On Button B
Finally the
On Button A+B
If / Then Statements
You may notice that there is a few
your Battle Bot in making decisions and knowing what it has to do next.
What You Should See
Before running the program, make a thick line (about 12" wide x 6" long) using black electrical tape. This is where
your robot will meet with an opposing robot.
When the code initializes, the servo "arms" will move into a starting position and take initial readings for your line
sensors to establish a comparison point to the ground environment. Make sure to calibrate it with a black line
before starting. Then place each robot at an equal distance away from the line.
Initially, the Battle Bot will not move. Press on buttons A and B at the same time to run the program. The robot will
move forward if none of the line sensors detect the black line. If the center line sensor detects a black line, the
Battle Bot will immediately start both servos and move backwards. If the left or right line sensors detect a dark
surface, the side that detected it will have the corresponding jousting lance start to move while turning away from
it. So your Battle Bot is prepared to defend itself from any oncoming situation!
i
i
event blocks a lot. They allow us to break out different functions we want
On Button
event block resets the calibration value for the table surface for the robot to use
event block is used to run the program.
blocks inside of the if statement in the
if / then
b t kit E
b t kit E
5
5
block. This will aid
forever

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the micro:bot Kit and is the answer not in the manual?

Questions and answers

Table of Contents