PiGlow - olliebennett/raspberry-pi-scripts GitHub Wiki
PiGlow
Buy from Pimoroni.
Install
Instructions based on the RaspberryPi.org PiGlow Learning Article
sudo apt-get update
sudo apt-get upgrade
Install smbus
with the following command:
sudo apt-get install python-smbus
Check you have it installed correctly by entering:
sudo python -c "import smbus"
No output is good news.
Enable I2C driver modules
-
Edit the modules configuration file:
sudo nano /etc/modules
-
Then add the following line at the end of the file, if it's not already there:
i2c-dev
Press
CTRL + X
, followed byY
andEnter
to save your changes. -
Enter
sudo raspi-config
to open the Raspberry Pi Configuration Tool. -
Select
Advanced Options
and then chooseI2C
with the keyboard's up/down keys. Enable the I2C interface and kernel module when prompted, and you'll be prompted to reboot the Pi when finishing.
Python Module
We'll use the PyGlow python module.
git clone https://github.com/benleb/PyGlow
Move/copy examples out of their directory to run them
mv examples/test.py .
sudo python test.py
It should ask you to enter a series of colour values.
Note that for the cpy.py
example, you'll need psutil
:
sudo apt-get install python-psutil