Elecrow on-line store, make your making easier.
https://www.elecrow.com/
Material:
Micro:bit
x1
Crowtail- Base Shield for Micro:bit
x1
Crowtail- Magenet switch
x1
Crowtail- LED
x1
Lesson12.Control the MOSFET as a Switch
As MOSFET has a high speed response and high stability, we usually use it as a switch in some
application, this lesson will teach you how to control the MOSFET on/off. Connect the crowtail-
MOSFET to P0 interface and connect one LED to the output terminal of the MOSFET, then upload
the code into micro:bit, you will see the LED blink.
let
value =
0
basic
.
forever
(() => {
value =
pins
.
digitalReadPin
(DigitalPin.P0)
if
(value) {
pins
.
digitalWritePin
(DigitalPin.P0,
1
)
}
})