piGlow is a nice little board, providing 18 colored LED with an I2C-Controller.
With a major rework of the i2c-part of the scratchClient framework, I added support for this board / device in scratchClient.
Start it with
cd ~/scratchClient sudo python src/scratchClient.py -c config/config_SN3218.xml
The configuration uses some common variables to update the pwm-values in sync for all, for the ‘branches’ and – of course – the individual LED.
In the distribution, there is a simple scratch program, just providing variable definitions and some watchers on stage with sliders.
Not very graphic, I agree. But hopefully it saves some time in creating these 18 variable names (plus some more). It is in scratchClient/scratch/SN3218/piglow.sb
The branches are group names for the three wings arranged on the board.
The above sketch shows the piglow board in action, annotated with the channel numbers in hex.
As indicated on the package of piGlow, the LED can be VERY bright when full power is applied. Looking into these light could harm your eyes.
When adjusting the setup, be sure NOT to have the LED at full brightness.
Place the lens in the correct distance in front of piGlow. I first tried out which distance is needed by hand, and then fine tuned the focus by adding sheets of paper. It was needed to place the lens in a stable position for the photograph.
The center LED are opaque, the other LED show the bright chip inside the small package. The image in this setup was 15 times enlarged.
Again: never look into the bright light directly.