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 seconds blocks.
  • Then click on the "Raspberry Pi GPIO" block section and drag in two set gpio to output blocks. Set one block to set gpio to output high. Set the other to set gpio to output low
  • Lastly rearrange the blocks in the order as shown.

Now click the green flag and see what happens!

This guide was first published on Sep 21, 2019. It was last updated on Sep 21, 2019.

This page (Scratch 3 Blinky) was last updated on Sep 20, 2019.

Text editor powered by tinymce.