PCF8574 input driver
It works with PCF8574 IO expanders. You can see an guide on modifying them and connecting them to buttons & I2C here.
"input":
[{
"driver":"pcf8574",
"kwargs":
{
"addr":63,
"int_pin":4
}
}]
- class input.drivers.pcf8574.InputDevice(addr=63, bus=1, int_pin=None, sleep_interval=0.01, **kwargs)[source]
A driver for PCF8574-based I2C IO expanders. They have 8 IO pins available as well as an interrupt pin. This driver treats all 8 pins as button pins, which is often the case.
It supports both interrupt-driven mode (as fr now, RPi-only) and polling mode.
- __init__(addr=63, bus=1, int_pin=None, sleep_interval=0.01, **kwargs)[source]
Initialises the
InputDeviceobject.Kwargs:
bus: I2C bus number.addr: I2C address of the expander.int_pin: GPIO pin to which INT pin of the expander is connected. If supplied, interrupt-driven mode is used, otherwise, library does polling mode.
- runner_simple()[source]
Starts listening on the input device. Initialises the IO expander and runs either interrupt-driven or polling loop.