User Manual
17 18
Project 7 :  Shake Counter
Diculty Level
Part List
Description
7. Shake Counter
In this demo, every time your shake 
the micro:bt, it will increase the 
number displayed by 1. 
1x Grove - 4-Digit Display
1x Grove Shield for micro:bit
1x micro:bit
Steps
1. Add basic block on start, then add variable block 
set item to 0, rename ‘item’ to ‘Display’. If you have 
added the Grove Package successfully, add block 
4-Digit Display at (P0) and (P14).
2. Add input block on shake, then add variable 
block change item by 1,rename ‘item’ to ‘N’.
5. Hardware connection: Connect the Grove – 
4-Digital Display to P0 port of Grove shield for 
micro:bit.
6. Click Download to transfer your code in your 
micro:bit.
7. Shake the micro:bit and you will find the number raises by 1 every time your shake the board.
Use this demo to play a game with you friend. See who can get 
the highest score in 1 minute.
3. Add block item show number from Grove 
Package, rename ‘item’ to ‘Display’, replace ‘0’ with 
variable block ‘N’.
4. Add basic block pause (ms) (100).
1
1
2
2
3
3
4
4
8888
:
2
1
1
2
3
3
P0/P14










