8. Project 3: Control Multiple Actuators Lv2¶
Level:
8.1. Part List¶
Mono-tone buzzer X1 (placed on Multiple Actuators for smart house)
Multiple Sensors for smart house X1
Multiple Actuators for smart house X1
Connecting Wire X1
micro:bit X1
USB Cable X1
8.2. Description¶
In project 3, this is level two to control multiple actuators and you can learn how to use micro:bit on shake to control mono-tone buzzer on and off together.
8.3. Steps¶
Basic (Add block on start) > House (Add block Initialize Smarthon multiple-sensor)
Variables (Make a Variable “Buzzer On”) > Variables (Add block set item to 0, change “item” to “Buzzer On”; “0” to Logic “false”)
Input (Add block on shake)
Logic (Add block if…then…else) > For if : Logic (Add block 0 = 0, change “0” to Variables “Buzzer On”; “0” to Logic “false”)
For then: House-More (Add block Set Buzzer to intensity 0, change “0” to “1023”) > Variables (Add block set item to 0, change “item” to “Buzzer On”; “0” to Logic “true”) > Basic (Add block show icon, change “heart” to “yes”)
For else: House-More (Add block Set Buzzer to intensity 0) > Variables (Add block set item to 0, change “item” to “Buzzer On”; “0” to Logic “false”) > Basic (Add block show icon, change “heart” to “no”)
8.4. Hardware¶
Download the code and transfer to micro:bit
Plug the micro:bit into Multiple Sensors
Connect Multiple Sensors and Multiple Actuators by connecting wire
Shook the micro:bit to turn on/off the buzzer * Try to use on shake to turn on/off other actuators.