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
P1 analog readings and thresholds for the surface value so you might have to customize these numbers to
suit your application.
true
true
P1
black_line_(i.e._Baseline_Value_of_Line_Following_Se
"
black line
serial write line
serial write string
set
black_line
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.