Presentation is loading. Please wait.

Presentation is loading. Please wait.

BBC Microbit.

Similar presentations


Presentation on theme: "BBC Microbit."— Presentation transcript:

1 BBC Microbit

2 Objective of the lesson
Use Block Editor to make a Love ‘O’ Meter All of you will: Create a random number if pin P0 is pressed Most of you will: Create a random message if pin P0 is pressed Some of you will: Create an image to accompany the message

3 Love O Meter We will use if, else if and else statements to check if you and a friend are a Love Match. One person will touch Pin 0 and the other GND. When you hold hands a circuit will be made which will start the program. Add an on P0 pressed loop Because the random number created will change this is called a variable. Add a variable

4 Because the random number created will change this is called a variable.
Add a variable At the moment the name of the variable is ‘item’. Change this to ‘LoveNumber’

5 The LoveNumber needs to create three random numbers, 0,1 or 2.
Add in ‘pick random’ 0 to 2 Add a message to say something appropriate

6 Add in if, else if, else conditions based on the size of the random number generated.
Add in strings to say what your ‘love match’ is

7 Challenge See if you can add in extra messages by creating more random numbers See if you can get it to add in images as well as messages. Maybe these will be hearts of different brightness depending on the love match See if you can develop a fortune teller game that tells your fortune when you make a connection between P0 and GND

8 Answers


Download ppt "BBC Microbit."

Similar presentations


Ads by Google