How do I use the GPIO pins in Python

I got the le potato as a pi alternative and I was trying to run the RFM9x adafruit library in python.
I was using the code here LoRa Raspberry Pi Setup | LoRa and LoRaWAN Radio for Raspberry Pi | Adafruit Learning System

It’s just a small script so see if the board is detecting the radio via spi. When I tried to run the script it says " DigitalInOut(board.D5)
AttributeError: board has no attribute ‘D5’ "

Essentially it’s trying to set the pin D5 on the pi to input but it can’t find that on this board. I tried to use the wiring-tool to find the equivalent pin ref but it still says board doesn’t have attribute.

You can use python3-gpiod via Bartoz’s python example. You need to get the gpio chip and line numbers from our lgpio tool.

I’ve installed python3-gpiod and I’ve installed the wiring tool.
I’m a little confused about how I can use the python example script, there’s no setting of a pin to input or output or anything

1 Like