Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lesson 4 – Glowing pendulum

Similar presentations


Presentation on theme: "Lesson 4 – Glowing pendulum"— Presentation transcript:

1 Lesson 4 – Glowing pendulum
Bbc microbit Lesson 4 – Glowing pendulum hot

2 Glowing pendulum Use a forever block so that your program will continue to run. Set up a variable called acceleration and store the acceleration (y) of the Microbit into this variable, this will allow your to use the data stored from the acceleration later in your program.

3 Glowing pendulum Now we need to make sure the acceleration comes out with a positive value so we need to take the absolute value of the acceleration we use the Math abs code to do this, then of course enter the variable acceleration.

4 Glowing pendulum Divide the acceleration value by 4 because we want a value between 0 and 256 and the variable currently has a number stored between 0 and 1024.

5 Glowing pendulum Firstly set the brightness of the LED’s depending on how fast the Microbit is moving then turn them on.

6 Glowing pendulum Upload the code to your Microbit and see what happens when you move your Microbit like a pendulum. If you have forgotten how to upload go back and look at lesson 1 and 2.

7 Glowing pendulum Answer these questions in assessment tool, you must answer these before you move onto the extension challenges.

8 Glowing pendulum Extension Challenge 1 Answer this in assessment tool.


Download ppt "Lesson 4 – Glowing pendulum"

Similar presentations


Ads by Google