Skip to the content.

Chuck a duck icon

Chuck a duck MicroCode program

This is a radio program so you’ll need 2 micro:bits running to get it to work. The program “sends” a duck using the radio by shacking the micro:bit.

In code, the accelerometer sensor is used in two rules to clear the screen (duck is gone) and send a number using the radio.

when shake, do clear screen

when shake, do radio send 1

The third rule uses the radio filter to render the duck on the screen. This rule executes when a radio message is received.

when radio receive 1, do show duck

when radio receive 1, play hello sound

Avoiding clashes with groups

If you try this activity with many micro:bits in the same room, they will all start to trigger the activity. You can avoid groups interference by

Improvement ideas

Video