Controlling a Pimoroni PiGlow using ScratchGPIO
This is a little fun add on from the Pimoroni gang http://www.pimoroni.com with 18 high brightness LEDs on it.
At the moment, it requires a bit of medium level geekery to get it going as you need to tell your Raspberry Pi that you want to use Pins 3 and 5 for a thing called the I2C bus. I recommend following the instructions here http://www.recantha.co.uk/blog/?p=2582
Make sure you’ve installed ScratchGPIO of course
You can then create variables Led1 to Led18 and set them to values between 0 (for off) to 255 (Fully on). You can also have variables for Red,Orange,Yellow,Green,Blue and White to refer to each of the colours and the the same for Leg1, Leg2 and Leg3.
This script shows a how using the the join statement you can blink each leg in turn without having to use a lot of if statements.