Welcome to the Scroll pHAT documentation. This page will guide you through the methods available in the Scroll pHAT python library.
The Scroll pHAT provides a matrix of 55 white LED 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!
- Learn more about Scroll pHAT: https://shop.pimoroni.com/products/scroll-phat
- Contribute examples & fixes: https://github.com/pimoroni/scroll-phat
Set A Single Pixel In Buffer¶
Scroll pHAT uses white LEDs which can be either on or off.
When you set a pixel it will not immediately display on Scroll pHAT, you must call
Set All Pixels In Buffer¶
Use a pixel shader function to set 11x5 pixels
Useful for displaying patterns and animations, or the result of simple functions. For example:
scrollphat.set_pixels(lambda x, y: (x + y) % 2, True)
Will display a check pattern.
- handler – A function which accepts an x and y position, and returns True or False
- auto_update – Whether to update Scroll pHAT after setting all pixels (default False)
Write A Text String¶
All of your changes to Scroll pHAT are stored in a Python buffer. To display them
on Scroll pHAT you must call
Clear Buffer And Display¶
Set The Brightness¶
Scroll The Buffer¶
Scroll To A Position¶
Rotate The Display¶
ROTATE_OFF = False
ROTATE_180 = True