bobrathbone / GPIOconverter

Convert GPIO calls to python3-lgpio calls

Home Page:https://bobrathbone.com/raspberrypi/gpio_converter.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RPi/GPIO.py

The GPIO.py code is only for use with the Raspberry Pi Model 5. Do not use it for earlier models such as the Model 3B or 4

It is designed to intercept GPIO calls and convert them to LGPIO calls. See: https://abyz.me.uk/lg/py_lgpio.html

OUTPUT: User Program --> GPIO calls --> GPIOconverter --> LGPIO

INPUT: LGPIO events --> GPIOconverter --> GPIO events --> User Program

Pre-requisites

Install package python3-lgpio

sudo apt install python3-lgpio

Downloading GPIOconverter

Log into the Raspberry Pi Model 5 and clone the GPIODconverter software and run:

git clone https://github.com/bobrathbone/GPIOconverter

Installation

Create a sub-directory called RPi in the directory where your GPIO code is installed For example code in directory /usr/share/radio:

cd /usr/share/radio

mkdir RPi

cp <source>/GPIO.py /usr/share/radio/RPi/.

Note: The radiod package installation script has already done this

Enabling GPIO.py

For a Raspberry Pi model 5 only. Example:

touch /usr/share/radio/RPi/__init__.py

The instruction above will cause the code using the GPIO calls to see directory RPi as a package.

For earlier models such as the 3B or 4 disable the package

rm /usr/share/radio/RPi/__init__.py

Licensing

GPIOconverter is released under the GNU General Public License version 2,

Support

It is not possible to provide support for GPIO.py as literally hundreds of thousands of programs are using GPIO routines. The code is provided as is and without any warranties or "fit for purpose" etc.

Bob Rathbone

https://bobrathbone.com

About

Convert GPIO calls to python3-lgpio calls

https://bobrathbone.com/raspberrypi/gpio_converter.html


Languages

Language:Python 100.0%