Output subsystem

Currently ZPUI uses HD44780-compatible screens as output devices. Minimum screen size is 16x2, 20x4 screens are tested and working. Available output drivers:

Screen object

The o variable you have supplied by main.py load_app() in your applications is a Screen instance. It provides you with a set of functions available to HD44780 displays. Most of drivers just provide low-level functions for HD44780 object, which, in turn, provides Screen object users with high-level functions described below:

class output.drivers.hd44780.HD44780(cols=16, rows=2, do_init=True, debug=False, buffering=True, **kwargs)[source]

An object that provides high-level functions for interaction with display. It contains all the high-level logic and exposes an interface for system and applications to use.

__init__(cols=16, rows=2, do_init=True, debug=False, buffering=True, **kwargs)[source]

Sets variables for high-level functions.


  • rows (default=2): rows of the connected display
  • cols (default=16): columns of the connected display
  • debug (default=False): debug mode which prints out the commands sent to display
  • **kwargs: all the other arguments, get passed further to HD44780.init_display() function
init_display(autoscroll=False, **kwargs)[source]

Initializes HD44780 controller.


  • autoscroll: Controls whether autoscroll-on-char-print is enabled upon initialization.

Displays data on display. This function checks if the display contents can be redrawn faster by buffering them and checking the output, then either changes characters one-by-one or redraws the screen completely.

*args is a list of strings, where each string corresponds to a row of the display, starting with 0.


Prints a line on the screen (assumes position is set as intended)


Returns cursor to home position. If the display is being scrolled, reverts scrolled data to initial position..


Clears the display.

setCursor(row, col)[source]

Set current input cursor to row and column specified

createChar(char_num, char_contents)[source]

Stores a character in the LCD memory so that it can be used later. char_num has to be between 0 and 7 (including) char_contents is a list of 8 bytes (only 5 LSBs are used)


Turn the display off (quickly)


Turn the display on (quickly)


Turns the underline cursor off


Turns the underline cursor on

Turn the blinking cursor off

Turn the blinking cursor on


These commands scroll the display without changing the RAM


These commands scroll the display without changing the RAM


This is for text that flows Left to Right


list of weak references to the object (if defined)


This is for text that flows Right to Left


This will ‘right justify’ text from the cursor


This will ‘left justify’ text from the cursor

Glue logic functions


Not for user interaction, are called by main.py, which is ZPUI launcher.


This function is called by main.py to read the output configuration, pick the corresponding drivers and initialize a Screen object. Returns the screen object created.