The WIC GPIO extension for Scratch 2 opens up the GPIO to allow for the driving of addressable LED strips using the WS2812 LEDs. It provides a range of commands used to control the outputs.
[eyes direction block]
This controls the eyes allowing you to select a direction for the eyes to look in, and a time before they move back into the center. The block will halt execution of the code until the timer has timed out, so use it in a separate flow to any code you require to happen during the this time.
[led colour and addressing block]
This block allows you to select an individual LED to light in the selected colour, or to light all of the LEDs in the selected colour. To create a chase effect on the LED strip you can add the block multiple times, selecting a different LED on each one. To control the speed of the chase add a wait block between each of the LED blocks specifying the same time on each block.
[led patterns block]
The LED patterns block allows you to select one of the following preset patterns to be displayed on the LED strips:
- Chasing single pixel
- Chasing pixel group
- Inverted chasing single pixel
- Inverted chasing pixel group
- Fade through rainbow of colours
- Red / Green / Blue alternating colours
[jaw position block]
This block allows you to control the jaw of the skeleton and has settings for open and closed. When used in conjunction with a sound being played it is possible to make the skeleton appear to be talking.