Skip to content

Conversation

Stephen-Hamilton-C
Copy link

Unfortunately, RPi.GPIO doesn't work on Raspberry Pi 5 as discussed by this forum post. This pull request helps to resolve this by adding support for lgpio, an easy-to-translate replacement for RPi.GPIO. The new file, lgpio.py, is based on the gpio.py file with some modifications to accommodate the new library. Additionally, documentation is updated to acknowledge the new file.

I've tested this on my own Raspberry Pi 5 with a 16x2 LCD and it Works On My Machine™

Copy link
Owner

@dbrgn dbrgn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have access to a Pi 5, so maybe someone else can give this code a try to confirm it to be working?

There's also a lot of duplication between lgpio and gpio that could be abstracted away using a shared base class. But in practice it's probably fine as-is.

docs/api.rst Outdated
CharLCD (lgpio)
===============

The main class for controlling GPIO (parallel) connected LCDs on Raspberry Pi 5
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be 5+, right? (Assuming that the GPIO won't change again in the next version.)

Suggested change
The main class for controlling GPIO (parallel) connected LCDs on Raspberry Pi 5
The main class for controlling GPIO (parallel) connected LCDs on Raspberry Pi 5+

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does adding or newer sound? e.g. The main class for controlling GPIO (parallel) connected LCDs on Raspberry Pi 5 or newer. 5+ to me almost sounds like a model number. I'm fine with 5+, but I'd rather be as clear as possible

<https://learn.adafruit.com/character-lcds/wiring-a-character-lcd>`_ to learn
how to wire up these circuits.

Note that if you are using a Raspberry Pi 5, you'll need to use this import
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again:

Suggested change
Note that if you are using a Raspberry Pi 5, you'll need to use this import
Note that if you are using a Raspberry Pi 5+, you'll need to use this import

Also in a few other locations below.

@Stephen-Hamilton-C
Copy link
Author

Just got back home from vacation - thanks for the notes. I'll address them on Monday

@Stephen-Hamilton-C
Copy link
Author

There's also a lot of duplication between lgpio and gpio that could be abstracted away using a shared base class. But in practice it's probably fine as-is.

I could certainly do this for you if you'd like. Would you rather this be a separate pull request or leave it in here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants