iopinsindex/home/perette/Projects/Skeezball/TestUtilities/iopins.py

InputPin and OutputPin wraps RPi.GPIO to provide a simpler, more straightforward interface for dealing with I/O channels in primitive ways.

Modules

sys

Classes

builtins.object
InputPin
OutputPin

class InputPin(builtins.object)

InputPin(pin_number: int, pull: int | None = None)

Create an input pin.
pin_number: The assigned GPIO channel or pin number.
pull: Specify application of a pull-up resistor: either GPIO.PUD_OFF (default), GPIO.PUD_HIGH, or GPIO.PUD_LOW.

Methods defined here:
__init__(self, pin_number: int, pull: int | None = None)

Initialize self. See help(type(self)) for accurate signature.

read(self) -> bool

Read pin.
Return value: True if high, false if low.

waitFor(self, event: int, timeout: int | float | None) -> bool

Wait for a transition on the pin.
event: Specifies GPIO.RISING, GPIO.FALLING, or GPIO.BOTH.
timeout: Duration to wait. Use None for indefinite wait.
Return value: True if the waited-on event occurred, false on timeout.


Data descriptors defined here:
__dict__

dictionary for instance variables (if defined)

__weakref__

list of weak references to the object (if defined)

class OutputPin(builtins.object)

OutputPin(pin_number: int, initial_state: int | None = None)

Methods defined here:
__init__(self, pin_number: int, initial_state: int | None = None)

Create an output pin with tri-state logic: high, low, float.
pin_number: The assigned GPIO channel or pin number.
initial_state: Either 0, 1, or "None" to float.

floating(self) -> None

Set output state to floating.

off(self) -> None

Set output state to low/off.

on(self) -> None

Set output state to high/on.


Data descriptors defined here:
__dict__

dictionary for instance variables (if defined)

__weakref__

list of weak references to the object (if defined)