
someone. The blocks in Figure
A
will do that.
Note that the icon of the micro:bit on the left side
of the screen allows you to simulate the code,
including “shaking” it.
The code begins with an on start block
which will run once, and two on gesture event
blocks that wait for input (whether the logo has
been touched, and whether the accelerometer
has detected a shaking motion). Experiment
with adding more blocks to do different things
as the board moves around. You might want to
try different gesture inputs (tilt it, flip it, etc.),
and explore adding more-advanced logic and
gestures, by nesting one input inside the other.
The micro:bit can also ...