Double check to make sure they are hooked up correctly and in the proper orientation
Experiment 3a -- Simple IR Sensor Reading
Let's break up this experiment into two parts. First, we will have the micro:bot follow a straight dark, black line.
Then we will have a slightly more complex path to try to have the micro:bot drive around a path with a zigzagged
pattern.
Running Your Script
Be sure to add the moto:bit package as instructed in the Installing the moto:bit Package in MakeCode section of
this tutorial.
Now, you can either download the following example script below and drag and drop it onto your micro:bit, or use it
as an example and build it from scratch in MakeCode.
Calibration
is very important with the line sensors to work accurately. Your environment will greatly affect the
P0 and P2 analog readings and thresholds for the surface values so you might have to customize these
numbers to suit your application.
true
true
turn motors
set
right
motor invert to
set
left
motor invert to
serial redirect to USB
on start
Microsoft MakeCode Terms of Use Privacy
Download
Edit
Simulator
Blocks
JavaScript
This site uses cookies for analytics, personalized content and ads. By continuing to
browse this site, you agree to this use.