Adafruit CharLCD Plate&Chinese “LCD RGB KEYPAD” shield input driver

This driver works with Adafruit Raspberry Pi character LCD&button shields, as well as with Chinese clones following the schematic (can be bought for 5$ on eBay, typically have “LCD RGB KEYPAD ForRPi” written on them).

Sample config.json section:

"input":
   [{
     "driver":"adafruit_plate"
   }]

Note

Generally, you won’t need to edit config.json if you’re using this shield because it’ll be done automatically by config.sh.

class input.drivers.adafruit_plate.InputDevice(addr=32, bus=1, **kwargs)[source]

A driver for Adafruit-developed Raspberry Pi character LCD&button shields based on MCP23017, either Adafruit-made or Chinese-made.

Tested on hardware compatible with Adafruit schematic and working with Adafruit libraries, but not on genuine Adafruit hardware.

__init__(addr=32, bus=1, **kwargs)[source]

Initialises the InputDevice object.

Kwargs:

  • bus: I2C bus number.
  • addr: I2C address of the expander.
init_expander()[source]

Initialises the IO expander.

process_data(data)[source]

Checks data received from IO expander and classifies changes as either “button up” or “button down” events. On “button up”, calls send_key with the corresponding button name from self.mapping.

readMCPreg(reg)[source]

Reads the MCP23017 register.

runner()[source]

Polling loop (only one there can be on this shield, since interrupt pin is not connected).

setMCPreg(reg, val)[source]

Sets the MCP23017 register.