pxt-calliope/docs/getting-started/shake.md
2016-06-23 23:52:24 -07:00

23 lines
518 B
Markdown

# Shake
You can find when someone is shaking the BBC micro:bit by checking its
**accelerometer** (it finds whether the micro:bit is speeding up or
slowing down).
Unscramble these blocks in the editor to show a frownie when someone
shakes the micro:bit. (Ouch!)
```shuffle
input.onGesture(Gesture.Shake, () => {
basic.showLeds(`
. . . . .
. # . # .
. . . . .
. # # # .
# . . . #`);
});
```
Click **Compile** to move your program to the BBC micro:bit!
## [NEXT: COIN FLIPPER GAME](/getting-started/coin-flipper)