Welcome¶
This documentation will guide you through the methods available in the Piglow python library.
Piglow is a simple blinky LED add-on with 18 LEDs in 6 different colours.
- More information - https://shop.pimoroni.com/products/piglow
- GPIO Pinout - https://pinout.xyz/pinout/piglow
- Get the code - https://github.com/pimoroni/piglow
- Get help - http://forums.pimoroni.com/c/support
At A Glance¶
Set One Colour¶
Each of Piglow’s rings consists of a different LED colour, from inside-to-out:
White, Blue, Green, Yellow, Orange, Red.
You can also call the colour names as functions, eg: piglow.white(255)
-
piglow.
colour
(colour, intensity)[source] Set all LEDs of a particular colour to specified intensity
Parameters: - colour – text name of LED colour; red, orange, yellow, green, blue, white
- intensity – brightness from 0 to 255
Set A Single LED¶
-
piglow.
led
(led_index, intensity)[source] Compatibility function for old PiGlow library Accepts LED between 1 and 18. Calls set(led - 1, intesity)
Parameters: - led_index – LED number from 1 to 18
- intensity – brightness from 0 to 255
LED Bargraph¶
-
piglow.
leg_bar
(leg_index, percentage)[source] Display a bargraph on a leg.
A leg/arm/spoke is the line of 6 LEDs the emanates from the center of Piglow to the edge.
Parameters: - leg_index – leg from 0 to 2
- percentage – percentage to display in decimal
LED Bargraph¶
-
piglow.
leg_bar
(leg_index, percentage)[source] Display a bargraph on a leg.
A leg/arm/spoke is the line of 6 LEDs the emanates from the center of Piglow to the edge.
Parameters: - leg_index – leg from 0 to 2
- percentage – percentage to display in decimal
Set LEDs¶
-
piglow.
set
(leds, value)[source] Set one or more LEDs with one or more values.
You can set multiple LEDs with the same value, or supply a list of LEDs and values.
Parameters: - led – A single index, or list of indexes of the LEDs to set
- value – A single value, or list of values to set
Single by Leg/Ring¶
-
piglow.
single
(leg_index, ring_index, intensity)[source] Sets a single LED by its leg/ring
Parameters: - leg_index – leg index of LED
- ring_index – ring index of LED
- intensity – brightness from 0 to 255
Tween¶
-
piglow.
tween
(duration, end, start=None)[source] Tweens to a particular set of intensities. Also accepts an optional starting point, otherwise the current state of the LED is used.
Parameters: - duration – duration in seconds
- end – list of 18 values to tween to
- start – list of 18 values to start from