Elecrow on-line store, make your making easier.
https://www.elecrow.com/
Material:
Micro:bit
x1
Crowtail- Base Shield for Micro:bit
x1
Crowtail- MOSFET
x1
DC Motor
x1
Lesson5.Motion Detection
This lesson teach you use the PIR Motion sensor to detect movement, then with other parts
can do many interest application. Connect the Crowtail- PIR sensor to P2 interface, and connect
one LED to P1 interface, then upload the code, when a person or other animals move close to
this motion sensor the LED will light on 1 second.
input
.
onButtonPressed
(Button.A, () => {
pins
.
digitalWritePin
(DigitalPin.P1,
1
)
})
input
.
onButtonPressed
(Button.B, () => {
pins
.
digitalWritePin
(DigitalPin.P1,
0
)
})