Learning Intention
- I can program a robot to repeat movements with a random wait between
Introduction

How often do you blink? How long is a blink? Are there times when you blink more or less often? When and why? Could we make Picoh blink a bit like we do?
Teacher Input
Discuss whether humans blink regularly. Introduce the idea of a random wait between blinks, using the `pick random` operator from the Operators palette. The two numbers in the operator set the range that the random number is picked from. We can use our random blink program as a skeleton to make other parts of Picoh move at random intervals.
Activities
Challenge children to write a program to make Picoh blink once when the green flag button is clicked. It might help to get children to think about the starting position of the blink. If Picoh's eyelids start from open, LidBlink will be in position 10, so the first instruction to run will need to set LidBlink to 0 to close Picoh's eyes.

Challenge children to alter their programs to make Picoh blink continuously. Explore how the length and frequency of blinks can be altered by altering the values of the wait instructions.
Discuss whether humans blink in this way. Introduce the pick random operator from the Operators palette and encourage children to introduce this into their program, investigating the values to make Picoh's blinks as realistic as possible.

Can you write a program so that Picoh continuously nods its head with a random wait between nods? File, Save As - headshake

Can you write a program so that Picoh continuously shakes its head with a random wait between shakes?

Extension
Challenge children to create a program that makes Picoh have either alert eyes (infrequent short blinks) or sleepy eyes (frequent long blinks). They will need to use two random blocks within their code — the second sets the frequency of the blinks and the first sets how long each blink lasts.

Compare this with the sleepy eyes version of the same code.

Plenary
Questions:
- What did you make Picoh do?
- In which ways were your Picoh's movements similar to and different from the way you move?

Key Points
- LidBlink controls Picoh's eyelids (0 = closed, 10 = open).
- Use a loop for continuous actions such as blinking.
- `pick random [min] to [max]` (Operators palette) generates a random number in a range.
- Placing `pick random` inside a `wait` block creates variable delays.
- Randomness makes Picoh's movement look much less robotic.
- Two random blocks can control both how long a blink lasts and how often it happens.
Need Help?
If you're stuck on any part of this lesson, check out these resources: