Learning Intention
- I can program a robot to carry out two tasks at the same time
Introduction
What did we learn to do in the last lesson? (Use repeat.) This week we will use repeat again. In addition, we will see that Picoh can do two things at the same time! We will learn to write two scripts that run at the same time in the same program so that Picoh can perform two tasks simultaneously. What do you think the word simultaneously means? Ask children to stand up. Can they nod their head and clap their hands at the same time? They are performing two tasks simultaneously! What other moves can they perform simultaneously? What moves could Picoh perform simultaneously?
Teacher Input
Ask the children to open the Picoh program and go to New on the File menu to create a blank program. Explain that we can have two sequences of code in one program, similar to when we used the keyboard to control Picoh. However, both sequences will start with `when green flag clicked` and work simultaneously. Drag two `when green flag clicked` instructions into the new file. Explain that you can write a sequence of code below both instructions.
Activities
Can you write a program to make Picoh nod ten times while it blinks ten times?

Can you write a program to make Picoh turn its head left and right five times while it also turns its eyes left and right five times?
Can you write a program to make Picoh yawn and blink twice simultaneously?

Extension
Can you write your own program in which Picoh performs three moves simultaneously?
Plenary
How did you find today's lesson? (Thumbs up, down, middle).
Questions:
- Who successfully programmed Picoh to perform two tasks simultaneously?
- Did anyone complete the extension?
- Which three tasks work well together?

Key Points
- A single program can hold more than one script.
- Two scripts that both start with `when green flag clicked` run at the same time.
- Running scripts simultaneously makes Picoh's movement look far more lifelike.
- Each script controls its own motor, so they don't fight over the same one.
Need Help?
If you're stuck on any part of this lesson, check out these resources: