Welcome

This documentation will guide you through the methods available in the Unicorn HAT HD python library.

Unicorn HAT HD provides a matrix of 256 RGB pixels that is ideal for writing messages, showing graphs, and drawing pictures. Use it to output your IP address, show CPU usage, or just play pong!

At A Glance

Unicorn HAT HD library.

Drive the 16x16 RGB pixel Pimoronu Unicorn HAT HD over SPI from a Raspberry Pi or compatible platform.

class unicornhathd.Display(enabled, x, y, rotation)[source]

Represents a single display in a multi-display chain.

Contains the coordinates for the slice of the pixel buffer which should be visible on this particular display.

get_buffer_window(source)[source]
update(x, y, rotation)[source]
unicornhathd.brightness(b)[source]
unicornhathd.clear()[source]
unicornhathd.enable_addressing(enabled=True)[source]
unicornhathd.enable_display(address, enabled=True)[source]
unicornhathd.get_pixel(x, y)[source]
unicornhathd.get_pixels()[source]
unicornhathd.get_rotation()[source]
unicornhathd.get_shape()[source]
unicornhathd.off()[source]
unicornhathd.rotation(r)[source]
unicornhathd.set_all(r, g, b)[source]
unicornhathd.set_layout(pixel_map=None)[source]
unicornhathd.set_pixel(x, y, r, g, b)[source]
unicornhathd.set_pixel_hsv(x, y, h, s=1.0, v=1.0)[source]
unicornhathd.setup()[source]
unicornhathd.setup_buffer(width, height)[source]
unicornhathd.setup_display(address, x, y, rotation)[source]
unicornhathd.shade_pixels(shader)[source]
unicornhathd.show()[source]

Set A Pixel

Unicorn HAT HD library.

Drive the 16x16 RGB pixel Pimoronu Unicorn HAT HD over SPI from a Raspberry Pi or compatible platform.

unicornhathd.set_pixel(x, y, r, g, b)[source]
unicornhathd.set_pixel_hsv(x, y, h, s=1.0, v=1.0)[source]

Set Brightness

Unicorn HAT HD library.

Drive the 16x16 RGB pixel Pimoronu Unicorn HAT HD over SPI from a Raspberry Pi or compatible platform.

unicornhathd.brightness(b)[source]

Set Rotation

Unicorn HAT HD library.

Drive the 16x16 RGB pixel Pimoronu Unicorn HAT HD over SPI from a Raspberry Pi or compatible platform.

unicornhathd.get_rotation()[source]
unicornhathd.rotation(r)[source]

Show The Buffer

Unicorn HAT HD library.

Drive the 16x16 RGB pixel Pimoronu Unicorn HAT HD over SPI from a Raspberry Pi or compatible platform.

unicornhathd.show()[source]

Clear The Buffer

Unicorn HAT HD library.

Drive the 16x16 RGB pixel Pimoronu Unicorn HAT HD over SPI from a Raspberry Pi or compatible platform.

unicornhathd.clear()[source]

Clear The Display

Unicorn HAT HD library.

Drive the 16x16 RGB pixel Pimoronu Unicorn HAT HD over SPI from a Raspberry Pi or compatible platform.

unicornhathd.off()[source]

Porting From Unicorn HAT

The Unicorn HAT HD library has been structured to make it easier to port your code from Unicorn HAT.

A couple of methods exist solely for this purpose; get_shape and set_layout:

Unicorn HAT HD library.

Drive the 16x16 RGB pixel Pimoronu Unicorn HAT HD over SPI from a Raspberry Pi or compatible platform.

unicornhathd.get_shape()[source]
unicornhathd.set_layout(pixel_map=None)[source]