sparkfun micro:bot Kit Experiment Manual page 57

Table of Contents

Advertisement

constantly loops when the B button is pressed. That way we have the benefits of both the event block and the
block without needing complicated programming.
loop
If Condition Statements
We'll use
statements once again to check the sensor readings and move the micro:bot:
if/else
Case 1:
If both are reading the same, move forward.
Case 2:
If the left sensor sees a dark black line but the other does not, move forward and a little to the left
toward the dark black line closer to the left side of the micro:bot.
Case 3:
If the right sensor sees a dark black line but the other does not, move forward and a little to the
right toward the dark black line closer to the right side of the micro:bot. There are slight differences in
the motors and wheels so we tweak the left motor strength a bit so that the micro:bot actually turns
toward the right (
).
50 + 5

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