AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ Year plan · Computing

A sound board

Week 20 · Unit 8: Be a musician · 3 lessons
1

More ways to start

Computing 3: Unit 8, pp. 119–134
GoalChoose the right input for a micro:bit program: a button, both buttons, a shake or the logo.
New words
A+B · pressing both buttons at the same timeshake · moving the board quickly so its sensor can feel itlogo · the touch-sensitive gold mark on newer micro:bit boards
Explanation

Buttons A and B are not the only inputs. You can also press A and B together, shake the board, or touch the logo on newer boards. Each one is a hat block in the Input group, with a drop-down list to choose the button or movement. Choose the input that fits the job. Shaking suits a rattle or a dice. Pressing both buttons suits a special action that nobody does by accident. One program can have several input blocks. Each one starts its own script.

Aon buttonApressedshow iconduckA+Bon buttonA+Bpressedshow iconcowShakeonshakeshow iconsnakeLogoon logopressedshow iconrabbit
Worked examples
InputHow to make itA good job for it
button Apress Astart a tune
button Bpress Bstop or change a tune
A+Bpress both buttons togethera special action
shakeshake the boarda rattle or a dice
logotouch the gold logoa surprise
Each input has a way to make it happen and a job it is good for.
onshakeshow iconbutterflyplay soundtwinkleuntil done
A magic wand: when the board is shaken it shows a butterfly and plays the twinkle sound until it is done.
Script 1on buttonApressedshow iconduckScript 2on buttonBpressedshow iconcow
A program can have a script for each input. Press A and the duck appears. Press B and the cow appears. The scripts do not disturb each other.
Class activity

Input charades (in a group): write five cards: press A, press B, press both, shake, touch the logo. Act them out: tap the left shoulder for A, the right shoulder for B, both shoulders for A+B, wiggle your whole body for shake and touch the top of your head for the logo. One player acts, the others call the input. Then add a program card, such as “shake: make a snake with your arm”. When the actor does the input, everyone follows the card. Which input was easiest to do by mistake?

Practice
1
Which input would you choose for a board that works like a rattle?
2
You shake the board with this program. Which icon appears?
Aon buttonApressedshow iconhouseBon buttonBpressedshow iconumbrellaShakeonshakeshow iconghost
3
Why can one program have more than one input block?
4
You press button A and button B together with the program in question 2. Which script runs?
ABpress A+B