Learning Objectives

LO: Understand what variables are and why and when to use them in a program

LO: Understand the importance giving variables logical names

MAIN

Click here to open the code window!

Tasks

1.Create a program like the one shown below. What does it do?

Picture1.png

2.Create a new variable, name it “adjustment“, set it to 3 and put it in the on start block

Picture4

3.Instead of setting “count+/- 1, set count to +/- adjustment

Picture3

4.Use the A+B buttons pressed event handler to reset the counter to 0 and display it

Picture1.png

Now grab a Microbit from your teacher!

5.Create your own pedometer using the Microbit. Use the “On Shake” event to help you do this! You also need to be able to reset your pedometer. Your challenge is to code this up and then get your program onto the Microbit and test if it actually works.

Watch the video below to show you how to get your program onto your Microbit!

Knowledge Check

Click on the image below to test your knowledge of today’s learning!zwxlurbk_How-to-Create-a-Successful-E-Learning-Knowledge-Check