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.

At A Glance

piglow.all(value)[source]
piglow.clear()[source]
piglow.colour(colour, intensity)[source]
piglow.led(led_index, intensity)[source]
piglow.leg_bar(leg_index, percentage)[source]
piglow.off()[source]
piglow.ring(ring_index, value)[source]
piglow.set(leds, value)[source]
piglow.show()[source]
piglow.single(leg_index, ring_index, intensity)[source]
piglow.tween(duration, end, start=None)[source]

Set All LEDs

piglow.all(value)[source]

Set all LEDs to a specific brightness

Clear All LEDs

piglow.clear()[source]

Set all LEDS to 0/off

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

Turn Off

piglow.off()[source]

Set all LEDs to 0/off

Set Ring

piglow.ring(ring_index, value)[source]

Set the brightness of a specific ring

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

Show

piglow.show()[source]

Output the contents of the values list to PiGlow.

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