Documentation
I2C Extension
The I2C extension controls and monitors components over an I2C bus, including character displays for showing messages.
Overview
The i2c extension controls and monitors components over an I2C bus. Provided are a set of interfaces through the support of adafruit-blinka and the adafruit-circuitpython-charlcd library (available on PyPI). There are a large variety of supported Linux boards that you can use I2C on.
This extension does not take an extension-level config and is focused on interfaces.
Character Display Interface
Connect and control a character display over I2C to display messages.
| Option | Type | Required | Description |
|---|---|---|---|
key |
String | Yes | Unique slug id for the component |
address |
Integer | Yes | The I2C address of the display (as an integer). Default: 39 |
name |
String | No | Friendly display name of component. Useful for UI. |
model |
String | No | Model of display to use. Options: i2c, rgb, or pcf. Default: i2c |
default_duration |
Integer | No | Time in seconds for messages to be displayed on screen by default when no duration is provided. Default: 5 |
max_duration |
Integer | No | The max time in seconds that messages can be on the screen. Default: 60 |
message_limit |
Integer | No | Number of messages to accept into queue before overwriting. Default: 20 |
topic |
String | No | Channel to listen for events on. Default: char_display/{key} |
persist_display |
Boolean | No | Set to true to keep last message on screen when no new messages are available. Default: false |
Config Example
Here is a config of a complete I2C display.
mudpi.config.json
{
"char_display": [
{
"key": "i2c_display_1",
"interface": "i2c",
"address": 39,
"name": "I2C LCD Display",
"model": "pcf",
"max_duration": 30,
"default_duration": 10,
"topic": "char_display/i2c_display_1",
"message_limit": 20,
"persist_display": false
}
]
}