Elecrow on-line store, make your making easier.
https://www.elecrow.com/
Material:
Micro:bit
x1
Crowtail- Base Shield for Micro:bit
x1
Crowtail- PIR Motion Senor
x1
Crowtail- LED
x1
Lesson6. Relay ON/OFF
The relay has used in may place in our daily life, so we must to know how to use it. Connect the
Crowtail- Relay to P1 interface,then upload the code into Micro:bit, you will hear a mechanical
on/off sound from the relay every 2 seconds, if you connect some other high voltage device to
the output terminal of the relay, then we can control this device on/off.
basic
.
forever
(() => {
pins
.
digitalWritePin
(DigitalPin.P1,
pins
.
digitalReadPin
(DigitalPin.P2))
basic
.
pause
(
1000
)
})