Elecrow on-line store, make your making easier.
https://www.elecrow.com/
Material:
Micro:bit
x1
Crowtail- Base Shield for Micro:bit
x1
Crowtail- Buzzer
x1
Lesson4. Motor Control
DC motor is a very common component in DIY, this lesson will teach you control the motor
rotation. As we know, the motor need a large current to drive itself, so we need a mosfet to
control the motor run and stop. Connect the Crowtail- MOSFET to P1 interface and connect the
DC motor to the output terminal of the MOSFET. Upload the code, when press button A, the
motor start run, when press button B, the motor stop run.
basic
.
forever
(() => {
pins
.
digitalWritePin
(DigitalPin.P1,
1
)
basic
.
pause
(
500
)
pins
.
digitalWritePin
(DigitalPin.P1,
0
)
basic
.
pause
(
500
)
})