Package: piglow
The PiGlow is a small add on board for the Raspberry Pi that provides 18 individually controllable LEDs.Learn more:https://shop.pimoroni.com/products/piglowThis repository contains the library and examples for the PiGlow board.InstallationFull install ( recommended ):We've created a super-easy installation script that will install all pre-requisites and get your Piglow up and running in a jiffy. To run it fire up Terminal which you'll find in Menu -> Accessories -> Terminal on your Raspberry Pi desktop like so:In the new terminal window, run our easy installer by typing:curl-sShttps://get.pimoroni.com/piglow|bashIf you choose to download examples you'll find them in/home/pi/Pimoroni/piglow/.Library install for Python 3:on Raspbian:sudoapt-getinstallpython3-piglowother environments:sudopip3installpiglowLibrary install for Python 2:on Raspbian:sudoapt-getinstallpython-piglowother environments:sudopip2installpiglowIn all cases you will have to enable the i2c bus.Documentation & SupportPiGlow GPIO Pinout -https://pinout.xyz/pinout/piglowFunction reference -http://docs.pimoroni.com/piglow/Get help -http://forums.pimoroni.com/c/supportBackwards CompatibilityThe PiGlow Python library is designed to support examples written for Jason's PiGlow library found here:https://github.com/Boeeerb/PiGlowIt's compatible with the examples, and we've ported some over to show you how it's done.Using PiGlowTo use the piglow library, you'll probably want to start by importing it:importpiglowNow, you can turn some LEDs on:piglow.red(64)Nothing will happen yet, you've got to update PiGlow with your changes. Why? Because it's quicker! If you're setting up a pattern it costs time and resources to redraw every step of that setup to the PiGlow, so we don't do that. Instead you need to callshowlike so:piglow.show()A bug is a feature you can't turn off, however, so if you want to change that behaviour you can set it after importing piglow:piglow.auto_update=TrueThis will turn on auto update, refreshing the PiGlow after each change so you don't have to.Function ReferenceSettingspiglow.auto_update- Set to True or False, determines if the PiGlow should automatically update after each LED changepiglow.clear_on_exit- Set to True or False, determines if the PiGlow should be cleared on exitColourspiglow.white( value from 0 to 255 )piglow.blue( value from 0 to 255 )piglow.green( value from 0 to 255 )piglow.yellow( value from 0 to 255 )piglow.orange( value from 0 to 255 )piglow.red( value from 0 to 255 )Arm, Spoke, Leg, they're all the same thing!piglow.arm( index from 0 to 2, value from 0 to 255 )Multiple LEDs in various different waysThesetmethod accepts a list of LEDs, a list of values, or a single LED or value, or any permutation therein:piglow.set(0, 255)- sets LED 0 to full brightnesspiglow.set([1,3,5,7,9,11,13,15,17],255)- sets all odd LEDs to full brightnesspiglow.set(0,[50,50,50])- let the 3 LEDs starting at index 0 to 50 brightnessOther support for PiGlowGordon Henderson(@drogon on Twitter) has very kindly added support for PiGlow into his very popular wiringPi library and even includes a basic command line tool that you can use to control your PiGlow!http://wiringpi.com/dev-lib/piglow/Simon Walters(@cymplecy) has added awesome PiGlow support to his Raspberry Pi GPIO Scratch library:http://cymplecy.wordpress.com/2013/08/12/scratch-gpio-piglow-support/Jason Barnetthas put together a great Python class and a load of samples:https://github.com/Boeeerb/PiGlowBen Lebherzhas forked Jasons project and tidied up the code a bit while adding gamma correction:https://github.com/benleb/PyGlowManuel Ernsthas created a Node.js library:https://github.com/zaphod1984/node-piglowMore informationFor more information the datasheet for the SN3218 IC is included in this repository which outlines the complete communication protocol for the chip.For those wanting to wire up their PiGlow in other ways these are the GPIO pins used by the module:P1 & P17 (3V3)P2 (5V)P14 (GND)P3 (SDA)P5 (SCL)Special ThanksA special thanks for Jason Barnett for carrying the PiGlow torch with his original library.
1.2.5Improved docstringsDefer setup to avoid import-time side effects. PR #17Fix issue with modulo. PR #21Fix & optimise tweeing. PR #231.2.4Addedversionto module1.2.3Removed ref to pimglow.py in MANIFESTAdded LICENSE.txt1.2.2Fixed legs.py for Python3 compatibility1.2.1Tweaks and tidying up1.2.0Promoted to stable"set" now defaults to a sensible LED order, wrapping "_set"Call "_set" directly for old bahaviour1.1.0Update to new PiGlow libraryrenamed my 'led' method to 'single'wrapped inherited 'set' to automatically call 'update'1.0.0Initial experimental module