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:
object
Initialize 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_path
parameter.- set_direction(direction: str) None [source]¶
Set Direction
Sets direction to
in
orout
- 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 aLOW
singnal, else on aHIGH
signal- Parameters:
value (bool) – Value
- get_active_low() bool [source]¶
Get Active Low
Reads value and returns direction
in
orout
- Return type:
- Returns:
Value
- get_direction() str [source]¶
Get Direction of GPIO
Reads direction and returns direction
in
orout
- Return type:
- Returns:
Value
- set_value(value: bool) None [source]¶
Set Value
Sets value to
HIGH
andLOW
- Parameters:
value (bool) – Value to set