Microbit Block Programming Step Counter CF
Microbit Block Programming Step Counter CF
Microbit Block Programming Step Counter CF
1
2
Step 3: Get rid of the forever block.
FYI: Variables are used in programs to store information that can change. In this
activity, it’s steps.
3
Step 8: Now, let’s make something happen when we shake our micro:bit. So, find
the [ ] block from the input tab.
Step 9: Grab the block, drag and drop the block to the right of the on start block
in your workspace.
Step 11: Grab the block, drag and drop inside the [ ] block.
FYI: This will change the value of the steps variable by 1 every time the micro:bit
is shaken.
4
Step 12: Find the [ ] block from the basic tab.
Step 13: Grab the block, drag and drop below [ ] block.
HERE!!!
Step 16: Continuously move the mouse pointer around on the simulator as if you are
shaking it. What happens?
5
Let’s Download the Code
Step 17: In the box that says Untitled, rename the file “Step Counter.” Then
Download.
The file will display in your Downloads folder as a hex file. Locate the
downloaded .hex file.
6
Step 19: Connect the micro:bit to your computer with a USB cable. The microUSB
port is on top of the micro:bit.
Step 20: Drag the .hex file from the Downloads folder to the MICROBIT drive.
To use the micro:bit away from your computer, disconnect the micro:bit from the
USB cable and connect the battery pack.