Connect Crowtail-Touch Sensor and Crowtail-Buzzer to P0 and P1 ports of Crowtail-Base shield
for Micro:bit. The hardware connections are as follows:
Programming and note
Digital Write:
Different from the last experiment, this time we will use
digital write
block to set the
buzzer 1(on), which can make the buzzer make a big bee noise to prevent touching. The
buzzer will stop sounding until you stop touching.
Download the program to micro:bit to see what happens.
If you put your hand on the touch sensor, the buzzer will make a large beep
to prevent touch. The buzzer will not stop sounding until you remove your
hand from the touch sensor.
Result
By learning this experiment, we know the touch sensor can sense our hand. So, if we
have many touch sensors and a buzzer, We can make a touch-type musical instrument
that allows us to play own melody?
14