Raspberry_Pi_Education_Manual

Notes:

To make the red lights appear to flash we must switch the two red light costumes repeatedly. We use a “repeat” loop for this. Build the script on the previous page. You’ll need to experiment with the number of repeats until you get the timing right.

This is the finished program for the lights, with all the blocks in place. Notice that you have three separate scripts, not touching each other.

The barrier

Now for the barrier: drag it until it sits on the barrier support, with its thicker end just resting on the top of the post. Each time the program starts, the barrier must be pointing upwards. Using a “point in direction [90]” block (from Motion) will take care of this.

A beginner’s guide to Scratch

43

Made with FlippingBook flipbook maker