OpenRoadCode
Public API reference for OpenRoadCode
Loading...
Searching...
No Matches
hardware_io.buttons.push_button_if.PushButtonIf Class Reference

Interface for a physical pushbutton. More...

Inheritance diagram for hardware_io.buttons.push_button_if.PushButtonIf:
hardware_io.buttons.rpi_gpio_push_button.RpiGpioPushButton

Public Member Functions

None start (self)
 Begin monitoring the pushbutton.
None stop (self)
 Stop monitoring the pushbutton.
PushButtonState get_state (self)
 Return the current pushbutton state.
None set_callback (self, PushButtonCallbackIf|None callback)
 Set or clear the callback object.

Detailed Description

Interface for a physical pushbutton.

Member Function Documentation

◆ get_state()

PushButtonState hardware_io.buttons.push_button_if.PushButtonIf.get_state ( self)

Return the current pushbutton state.

Returns
Current pressed or released state.

Reimplemented in hardware_io.buttons.rpi_gpio_push_button.RpiGpioPushButton.

◆ set_callback()

None hardware_io.buttons.push_button_if.PushButtonIf.set_callback ( self,
PushButtonCallbackIf | None callback )

Set or clear the callback object.

Parameters
callbackEvent receiver, or None to disable notifications.

Reimplemented in hardware_io.buttons.rpi_gpio_push_button.RpiGpioPushButton.


The documentation for this class was generated from the following file:
  • hardware_io/buttons/push_button_if.py