Use Scratch 2 to program the Pi to blink the LED.
- Click the orange "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 yellow "control" block group section and drag in a "forever" loop.
- Also from the "control" section, drag in two
wait 1 secs
blocks. - Then click on the "more blocks" block section and drag in two "set gpio to" blocks. Set one block to
set gpio 2 to output high
. Set the other to setgpio 2 to output low
. - Lastly rearrange the blocks in the order as shown above.
Now click the green flag and see what happens!
Text editor powered by tinymce.