PiFaceCAD input driver¶
This driver works with PiFace Control and Display Raspberry Pi shields.
Sample config.json section:
"input":
[{
"driver":"pfcad"
}]
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.pfcad.InputDevice[source]¶ A driver for PiFace Control and Display Raspberry Pi shields. It has 5 buttons, one single-axis joystick with a pushbutton, a 16x2 HD44780 screen and an IR receiver (not used yet).
-
__init__()[source]¶ Initialises the
InputDeviceobject and startspifacecad.SwitchEventListener. Also, registers callbacks topress_keymethod.
-
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.
-
send_key(keycode)[source]¶ A hook to be overridden by
InputListener. Otherwise, prints out key names as soon as they’re pressed so is useful for debugging.
-