Elecrow on-line store, make your making easier.
https://www.elecrow.com/
Material:
Micro:bit
x1
Crowtail- Base Shield for Micro:bit
x1
Crowtail- LED
x1
Crowtail- Linear Potentiometer
x1
Lesson10.Servo Calibrator
In this Lesson, will teach you how to use buttons to control the servo with different rotating angle,
and you can view the current angle from the LED dot matrix. Connect the Crowtail- Servo to P0
interface,then upload the code into micro:bit, press the button A, after seconds press button B,
view the servo rotated and read the current angle.
let
value =
0
basic
.
forever
(() => {
value =
pins
.
analogReadPin
(AnalogPin.P0)
pins
.
analogWritePin
(AnalogPin.P1,
value)
pins
.
analogSetPeriod
(AnalogPin.P1,
20000
)
})