The Crowtail- Switch is a Latching switch. When the switch is pressed for the
first time, the switch maintains current regulation and the button outputs a
HIGH signal in the self-locking state. When the switch is pressed for a second
time, the switch button pops up and the switch turns off and then outputs a
LOW signal. In fact, it is very similar to the button, except that the switch has a
self-locking function so that it can output logic high level signal without
pressing it all the time.
Connect Crowtail-Switch and Crowtail-LED to P0 and P1 ports of Crowtail-Base shield for
Micro:bit. The hardware connections are as follows:
Congratulations, you have mastered the method of controlling the LED on and off. But just like
the lights at home, can we add a switch to control the lights on and off at any time? Of course,
in this experiment, we will use our switch module to control the lights anytime and anywhere.
Learn how the switch work and use it to make a switch light with LED.
Learn how to use the if/else logic statement.
Learn how to read the state from the digital module.
Micro:bit x1
Crowtail-Base shield for Micro:bit x1
Crowtail-LED
(
Green
)
x1
Crowtail-Switch x1
Crowtail-Cable x2
USB cable x1
Target
Experiment 2 – Switch light
Instruction
Hardware learning and connection
Required Parts
10