Year 5 - Lesson 4
(Broadcasting)
Learning Intention
- I can broadcast a message.
Introduction
What did we learn to do last week? (ask and respond using if then else). This week we will build on our ask and respond with if then else. However, we will learn another new skill, we will learn to broadcast. What does broadcast mean? In the Ohbot programming software it means to send a message from one sequence of code to start another. This allows the same sequence of code to be started from multiple places in your program. We will learn how to broadcast a message called ‘well done’.
What did we learn to do last week? (ask and respond using if then else). This week we will build on our ask and respond with if then else. However, we will learn another new skill, we will learn to broadcast. What does broadcast mean? In the Ohbot programming software it means to send a message from one sequence of code to start another. This allows the same sequence of code to be started from multiple places in your program. We will learn how to broadcast a message called ‘well done’.
Teacher Input 1
First, we need to go to the Events palette and use New Message to create a message which we will call ‘well done’. We will need to use the instructions: broadcast well done, when I receive well done, as well as the usual start instruction - when green flag clicked. ObBot will ask the question: ‘What is 8x2?’ Again we will use an if then else statement. If the answer is 16 then we will broadcast our message ‘well done’. Initially our broadcast will be Ohbot saying a congratulatory message. If the answer is anything other than 16 it will say an appropriate response to the wrong answer. File, Save As – ‘broadcast well done’.
First, we need to go to the Events palette and use New Message to create a message which we will call ‘well done’. We will need to use the instructions: broadcast well done, when I receive well done, as well as the usual start instruction - when green flag clicked. ObBot will ask the question: ‘What is 8x2?’ Again we will use an if then else statement. If the answer is 16 then we will broadcast our message ‘well done’. Initially our broadcast will be Ohbot saying a congratulatory message. If the answer is anything other than 16 it will say an appropriate response to the wrong answer. File, Save As – ‘broadcast well done’.
Activity
1. Can you write code to broadcast your own message?
1. Can you write code to broadcast your own message?
Extension
We can take this one step further by adding sound and motion instructions to the broadcast so that Ohbot’s response is even more appropriate e.g. We can broadcast a round of applause and a head nod. Similar to our work last week, can you write some code to make Ohbot make a sound and nod its head when it receives the message well done?
Plenary
How did you find today’s lesson?
We can take this one step further by adding sound and motion instructions to the broadcast so that Ohbot’s response is even more appropriate e.g. We can broadcast a round of applause and a head nod. Similar to our work last week, can you write some code to make Ohbot make a sound and nod its head when it receives the message well done?
Plenary
How did you find today’s lesson?