Displays are used to show information to the user about the system and make data easy to obtain about operations. MudPi has support for a number of displays out of the box and is easy to expand support to others.
To add a display to MudPi you will put a display configuration object in the displays
array within a display
worker. The minimum required options in a display config are type
, pin
, and name
. Both the MCP and PCF I2C backpacks are supported.
{
"workers":[{
"type":"display",
"displays": [
{
"address":39,
"rows": 2,
"columns": 16,
"topic": "mudpi/lcd/1",
"model":"pcf"
}
]
}]
}
Option | Type | Required | Description |
topic | [String] | No | Topic of the display to listen for new message events. This will default to mudpi/lcd |
address | [Integer] | No | I2C address of the display. Since JSON does not support hex strings this value must be an integer. Hint: run `int(0x27)` in python to convert a hex address into an integer. |
columns | [Integer] | No | Number of columns the screen has. Typically this is 16 or 20 . Default: 16 |
rows | [Integer] | No | Number of rows the screen has. Typically this is 2 or 4 . Default: 2 |
model | [String] | No | Model of the display in order to load the proper i2c driver. Options: rgb or pcf . Default is None which uses MCP driver. |
default_duration | [Integer] | No | Number of seconds each message should be displayed for by default. When a message is added to the queue if a duration is not set then it will use this value. Default: 5 |
message_limit | [Integer] | No | Max number of messages allowed in the queue. Once the limit is reached a new message will push out the oldest message without displaying it. Default: 20 |
There are a number of displays supported by default with MudPi for both the raspberry pi and arduino. The main support is designed around the I2C displays in order to reduce wire needs. The I2C backpacks attached to the displays typically use one of two chips. Either a MCP or PCF chip is used on the module. MudPi has support for both drivers and allows you to specify a model
. Currently only character displays are supported.
MudPi makes use of the Adafruit_CircuitPython_CharLCD
library to add support for LCD displays. Currently the offical repo only supports I2C backpacks using the MCP chip. In order to support the other PCF chip displays a fork of the library which adds this capability is used. Official support will be complete once issue #29 on the main repo is resolved. Please note when installing the libraries that this fork is needed for PCF chip displays. The fork is already in the requirements.txt
file for your convenience.