The library itself is called libgpiod. That is the official GPIO library for Linux and provides a number of language bindings - C, C++, Python and Rust. The name isn't great, but that's what we've got.Is there any documentation for the GPIOD library.
I have found a few examples on line, such as the Toms Hardware python script that turns the LED on and off.
But, what I am looking for is a full list of what the library does and how to use it from python.
I have checked what I think is the the official library site
But there is nothing that is really useful, there are a couple of bits of sample code in the python folder, but not really useful.
I would like to know what the library can do, what are my options how to do things.
Any help showing me where the documentation is located and other python examples would be appreciated.
Wrt Python,
gpiod is the official Python bindings for libgpiod and so for Linux, developed by the Linux kernel developers.
gpiozero is the officially sanctioned library for Pis, AIUI that is developed by Pi devs.
Which is best for you depends on where you want to go.
Wrt libgpiod, of the links you list, the second is the official source location, the first is a mirror and location where you can raise issues. I would suggest going with v2 over v1, even if that means you need to install it yourself, as the APIs are very different.
You can install the Python module from PyPI using
Code:
pip install gpiod
You can generate the docs locally yourself using
Code:
python -m pydoc -p 1234
To see how to put everything together working examples are more useful than verbiage, so there are examples for many common use cases in each of the supported languages, including Python, in the source tree. If those are insufficient for you then make some suggestions and we can expand on them.
Statistics: Posted by warthog618 — Thu Mar 28, 2024 11:38 am