j5.components.button module

Classes for Button.

class j5.components.button.Button(identifier: int, backend: j5.components.button.ButtonInterface)[source]

Bases: j5.components.component.Component

A button.

identifier

An integer to identify the component on a board.

static interface_class() → Type[j5.components.button.ButtonInterface][source]

Get the interface class that is required to use this component.

is_pressed

Get the current pushed state of the button.

wait_until_pressed() → None[source]

Halt the program until this button is pushed.

class j5.components.button.ButtonInterface[source]

Bases: j5.components.component.Interface

An interface containing the methods required for a button.

get_button_state(identifier: int) → bool[source]

Set the state of a button.

wait_until_button_pressed(identifier: int) → None[source]

Halt the program until this button is pushed.