Raspberry Pi GPIO input driver

Driver for buttons connected to GPIO. Up to 8 button are supported now. Sample config.json:

"input":
   [{
     "driver":"pi_gpio",
     "kwargs":
      {
       "button_pins":[25, 24, 23, 18, 22, 27, 17, 4]
      }
   }]
class input.drivers.pi_gpio.InputDevice(button_pins=[], **kwargs)[source]

A driver for pushbuttons attached to Raspberry Pi GPIO. It uses RPi.GPIO library. Button’s first pin has to be attached to ground, second pin has to be attached to the GPIO pin and pulled up to 3.3V with a 1-10K resistor.

__init__(button_pins=[], **kwargs)[source]

Initialises the InputDevice object.

Kwargs:

  • button_pins: GPIO mubers which to treat as buttons (GPIO.BCM numbering)
  • debug: enables printing button press and release events when set to True
runner()[source]

Polling loop. Stops when stop_flag is set to True.