Next we'll program the Pi in Scratch to blink the LED.
- Click the yellow "events" block group, then drag and drop the "when (flag) clicked" block over to the "script area" on the right side of the program's interface.
- Next click the orange "control" block group section and drag in a "forever" loop.
- Also from the "control" section, drag in two
wait 1 secondsblocks.
- Then click on the "Raspberry Pi GPIO" block section and drag in two
set gpio to outputblocks. Set one block to
set gpio 2 to output high. Set the other to
set gpio 2 to output low.
- Lastly rearrange the blocks in the order as shown.
Now click the green flag and see what happens!