| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This is a python ctypes binding for libgpiod.
It's time to switch from the GPIO sysfs interface to gpiod to the linux GPIO character device (gpiod, stands for GPIO device)
Since linux 4.8 the GPIO sysfs interface is deprecated. User space should use the character device instead. This library encapsulates the ioctl calls and data structures behind a straightforward API.
from kernel.org
sudo apt install libgpiod1 pip install gpio-next
import time
from gpio_next import Output
LED = Output(64, default_value=0)
for i in range(10):
LED.write(i & 1)
time.sleep(1)from gpio_next import Input
button = Input(203)
for i in range(10):
print(button.wait())
print(button.read())| Back | FazBrowse Home | New Git URL |