Welcome

This documentation will guide you through the methods available in the Four Letter pHAT python library.

Four Letter pHAT is a Raspberry Pi add-on with four star displays.

At A Glance

Alphanumeric 14 segment LED backpack display.

fourletterphat.begin()
fourletterphat.clear()
fourletterphat.glow(period=4, duration=4)
fourletterphat.print_float(value, decimal_digits=2, justify_right=True)
fourletterphat.print_hex(value, justify_right=True)
fourletterphat.print_number_str(value, justify_right=True)
fourletterphat.print_str(value, justify_right=True)
fourletterphat.scroll_print(s, tempo=0.3)
fourletterphat.set_brightness(brightness)
fourletterphat.set_decimal(pos, decimal)
fourletterphat.set_digit(pos, digit, decimal=False)
fourletterphat.set_digit_raw(pos, bitmask)
fourletterphat.set_led(led, value)
fourletterphat.show()
fourletterphat.write_display()

Set A Single Digit

fourletterphat.set_digit(pos, digit, decimal=False)

Set digit at position to provided value.

Position should be a value of 0 to 3 with 0 being the left most digit on the display. Digit should be any ASCII value 32-127 (printable ASCII).

fourletterphat.set_digit_raw(pos, bitmask)

Set digit at position to raw bitmask value.

Position should be a value of 0 to 3 with 0 being the left most digit on the display.

Set A Decimal Point

fourletterphat.set_decimal(pos, decimal)

Turn decimal point on or off at provided position.

Position should be a value 0 to 3 with 0 being the left most digit on the display. Decimal should be True to turn on the decimal point and False to turn it off.

Set Brightness

fourletterphat.set_brightness(brightness)

Set brightness of entire display to specified value.

Supports 16 levels, from 0 to 15.

Clear The Display

fourletterphat.clear()

Clear contents of display buffer.

Update The Display

Once you’ve made your changes, you’ll need to update the display.

fourletterphat.show()

Display buffer on display.