GpioTriggerBase

class GpioTriggerBase[source]

Bases: object

Base class for defining custom GPIO trigger behavior.

Override trigger_on and trigger_off to react to the GPIO input pin (GPIO_IN, in DEVICE ADDRESSES) going from OFF (low) to ON (high) and back. The watching runs only while a task is active.

You have access to self.task, so any variable or function of the running task can be used.

__init__() None[source]

Initializes the GpioTriggerBase instance.

Methods

trigger_on() None[source]

Called when the input pin goes from OFF to ON. Override me.

trigger_off() None[source]

Called when the input pin goes from ON to OFF. Override me.