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!
More information - https://shop.pimoroni.com/products/unicorn-hat-hd
Get the code - https://github.com/pimoroni/unicorn-hat-hd
GPIO pinout - https://pinout.xyz/pinout/unicorn_hat_hd
Get help - http://forums.pimoroni.com/c/support
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.
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]