Documentation
Display Configuration
Configure LCD and character displays on the Raspberry Pi using I2C backpacks.
Overview
Displays are used to show information to the user about the system and make operational data easy to access. MudPi supports a number of displays out of the box and is easy to expand.
To add a display to MudPi, place a display configuration object in the displays array within a display type worker. 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"
}
]
}]
}
Settings
| Option | Type | Required | Description |
|---|---|---|---|
| `topic` | String | No | Topic the display listens on for new message events. Defaults to `mudpi/lcd`. |
| `address` | Integer | No | I2C address of the display. Since JSON does not support hex, use an integer. Run `int(0x27)` in Python to convert. |
| `columns` | Integer | No | Number of columns on the screen. Typically `16` or `20`. Default: 16. |
| `rows` | Integer | No | Number of rows on the screen. Typically `2` or `4`. Default: 2. |
| `model` | String | No | Model of the display to load the proper I2C driver. Options: `rgb` or `pcf`. Default uses MCP driver. |
| `default_duration` | Integer | No | Seconds each message is displayed for by default. Default: 5. |
| `message_limit` | Integer | No | Max messages in the queue. New messages push out the oldest when the limit is reached. Default: 20. |
Display Types
MudPi's display support is designed around I2C displays to reduce wiring needs. The I2C backpacks typically use either a MCP or PCF chip. MudPi supports both drivers and allows you to specify a model. Currently only character displays are supported.
Display Library Setup
MudPi uses the Adafruit_CircuitPython_CharLCD library for LCD display support. The official repo only supports MCP chip backpacks. For PCF chip displays, a fork of the library is used. The fork is included in the requirements.txt file for convenience.
Note
Official PCF chip support will be complete once issue #29 on the main repo is resolved.