rstem.button module
Module variables
Classes
A button from a GPIO port
Ancestors (in MRO)
- Button
- builtins.object
Static methods
def __init__(
self, port)
@param port: GPIO number (BCM mode) that button is plugged into @type port: int
def call_on_change(
self, event_callback, change='falling', bouncetime=300)
Calls given event_callback function when button changes state (example pressed).
@param event_callback: function to call when button changes state @type event_callback: function @param change: type of event to watch for (either button.PRESSED, button.RELEASED, or button.BOTH) @param bouncetime: msec to debounce button @type bouncetime: int8
@warning: Function must have the first argument be the port number
def remove_call_on_change(
self)
Removes the callback function set for this button. Does nothing if no callback function is set
def wait_for_change(
self, change='falling')
Blocks until given change event happens
@param change: type of event to watch for (either button.PRESSED, button.RELEASED, or button.BOTH)
def was_clicked(
self)