Welcome

This documentation will guide you through the methods available in the LED SHIM Python library.

LED SHIM provides a row of 24 tiny RGB LEDs which you can light up with any colour you like!

At A Glance

Represent an IS31LF3731 Matrix Display.

ledshim.clear()
ledshim.get_shape()
Matrix.height

Return height of device.

ledshim.set_all(r, g, b, brightness=1.0)
ledshim.set_brightness(brightness)
ledshim.set_clear_on_exit(value=True)
ledshim.set_gamma(gamma_table)
ledshim.set_pixel(x, r, g, b, brightness=1.0)
ledshim.setup()
ledshim.show()
Matrix.width

Return width of device.

Set A Single Pixel In Buffer

When you set a pixel it will not immediately display on LED SHIM, you must call ledshim.show().

ledshim.set_pixel(x, r, g, b, brightness=1.0)

Set a single pixel in the buffer.

Parameters:
  • x – Position of pixel from left
  • g, b (r,) – Intensity of the pixel, from 0 to 255.

Display Buffer

All of your changes to LED SHIM are stored in a Python buffer. To display them on LED SHIM you must call ledshim.show().

ledshim.show()

Show the buffer contents on the display.

Clear Buffer

ledshim.clear()

Clear the buffer.

You must call show after clearing the buffer to update the display.

Get The Display Size

ledshim.get_shape()

Get the size/shape of the display.

Returns a tuple containing the width and height of the display, after applying rotation.

Set Multiple Pixels

ledshim.set_multiple_pixels(indexes, from_colour, to_colour=None)[source]

Set multiple pixels to a range of colours sweeping from from_colour to to_colour.

Parameters:
  • from_colour – A tuple with 3 values representing the red, green and blue of the first colour
  • to_colour – A tuple with 3 values representing the red, green and blue of the second colour