tbot_contrib.gpio¶
A module containing gpio integration
- class tbot_contrib.gpio.Gpio(host: LinuxShell, gpio_number: int, *, sys_path: Path | None = None)[source]¶
Bases:
objectInitialize GPIO
Raspberry Pi Model 2 and above use as gpio_number their BCM GPIO Numbers
- Parameters:
host (linux.LinuxShell) – Linux Shell
gpio_number (int) – GPIO Number
sys_path (linux.Path) – Path to the
/sys/mountpoint if it differs from the default.
Changed in version 0.10.6: Added the
sys_pathparameter.- set_direction(direction: str) None[source]¶
Set Direction
Sets direction to
inorout- Parameters:
direction (str) – Direction to set
- set_active_low(value: bool) None[source]¶
Set Active Low
When Active Low is
True, the GPIO triggers on aLOWsingnal, else on aHIGHsignal- Parameters:
value (bool) – Value
- get_active_low() bool[source]¶
Get Active Low
Reads value and returns direction
inorout- Return type:
- Returns:
Value
- get_direction() str[source]¶
Get Direction of GPIO
Reads direction and returns direction
inorout- Return type:
- Returns:
Value
- set_value(value: bool) None[source]¶
Set Value
Sets value to
HIGHandLOW- Parameters:
value (bool) – Value to set