Interface for the PiGlow device on the Raspberry Pi
Perl 6
Switch branches/tags
Nothing to show
Latest commit 51b8526 Nov 4, 2017 @jonathanstowe jonathanstowe Add changes
Failed to load latest commit information.
examples There are only 6 rings not seven Jan 4, 2016
lib/RPi/Device Add the POD Jan 4, 2016
t Add basic stubs Jan 3, 2016
.gitignore Add precomp artefacts to the .gitignore Jan 3, 2016
Changes Add changes Nov 4, 2017
LICENCE rename LICENCE as en_GB May 30, 2016
META6.json update META Apr 29, 2017 No panda Aug 21, 2017


Interface for the PiGlow device on the Raspberry Pi


    use RPi::Device::PiGlow;
    my $pg =;

    my $values = [0x01,0x02,0x04,0x08,0x10,0x18,0x20,0x30,0x40,0x50,0x60,0x70,0x80,0x90,0xA0,0xC0,0xE0,0xFF];
    sleep 10;

See the examples directory for more ways of using this.


The PiGlow from Pimoroni is a small board that plugs in to the Raspberry PI's GPIO header with 18 LEDs on that can be addressed individually via i²c. This module uses RPi::Device::SMBus to abstract the interface to the device so that it can be controlled from a Perl programme. It is assumed that you have installed the OS packages required to make i2c work and have configured and tested the i²c appropriately. The only difference that seems to affect the PiGlow device is that it only seems to be reported by i2cdetect if you use the "quick write" probe flag:

sudo i2cdetect -y -q 1

(assuming you have a Rev B. or version 2 Pi - if not you should supply 0 instead of 1.) I have no way of knowing the compatibility of the "quick write" with any other devices you may have plugged in to the Pi, so I wouldn't recommend doing this with any other devices unless you know that they won't be adversely affected by "quick write". The PiGlow has a fixed address anyway so the information isn't that useful.

A useful quick guide to setting up for the Rapberry Pi 2 can be found at though most of that will work for other versions.


Assuming you have a working Rakudo Perl 6 installation you should be able to install this with zef :

# From the source directory

zef install .

# Remote installation

zef install RPi::Device::PiGlow


Suggestions/patches are welcomed via github at:

Because there are limited ways to test this automatically without physically observing the device, there may be untested bugs.


This is free software.

Please see the LICENCE file in the distribution

© Jonathan Stowe 2016, 2017