The educator makes sure that there are sufficient micro:bits for the learners to have one between two.
The educator keeps one back and downloads the transmitter code to it.
The receiver code is downloaded to all of the other micro:bits.
When doing the trick, the educator reads the script and when saying something that will make the micro:bit happy the educator presses button A, and when saying something that will make the micro:bit unhappy the educator presses button B.
The on start block sets the micro:bit's radio group.
A micro:bit can communicate with any other micro:bit with the same radio set group number.
In the code example below the radio group is set to 8.
The micro:bit sending out data is called the transmitter.
The micro:bit receiving the data is called the receiver.
Transmitter code Receiver code
Study the code above.
You will see that both micro:bits are set to the same radio group so that they can communicate with each other.
The transmitter's radio send number block transmits data to the receiver micro:bit when a button is pressed.
If button A is pressed it will send 1.
If button B is pressed it will send 0.
The receiver's on radio received block sets a variable called 'number' to the data received.
If 'number' = 1 the receiver micro:bit will display a happy face.
If 'number' = 0 the receiver micro:bit will display a sad face.
Educator:
'Power up your micro:bit.
Now look at the display on your micro:bit.
Your buggy has not had a run about for ages - It is probably feeling sad.
We are going to give your buggy a run - has that cheered it up?
But you don't know how to program your buggy - is it sad again?
You are going to learn how to program it! - that should cheer it up again.
Does your buggy really have emotions?
Discuss what is going on here.
At some point show the learners your concealed micro:bit and continue the discussion.
Learners should be able to work out that the micro:bits are communicating and it must be via a wireless connection - radio or blutooth or wi-fi.
Interaction at a distance feels like magic.
Magic might be useful if you’re an elf, wizard or unicorn, but such things only exist in stories.
However, there is something much better than magic: science!
Using the example of the magic trick, join together with another group and create a game of Multi Dice.
Use the instructions from this link.
Do NOT use radio group 1 as this will create interference from other groups. Between your groups pick your own secret number.
The magic trick worksheet