Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 3582

Python • Gpiod 'get_line' Error

$
0
0
Hello, I have a Raspberry Pi 5 with the 64 Bit OS installed and im trying to run my GUI program that was built for the Pi 4, however im aware that RPi.GPio does not work on the Pi 5 anymore. So im trying to use gpiod. But I get a couple of errors

Code:

import gpiodchip = gpiod.Chip('gpiochip0') 
with just this i get an error saying FileNotFoundError : [Errno 2] No such file or directory.

so i tried

Code:

chip = gpiod.Chip('/dev/gpiochip0')
and it worked with no errors, however when trying to use this

Code:

 led_line = chip.get_line(LED_PIN)  
I get

Code:

 AttributeError: "chip" object has no attribute "get_line". Did you mean: "get info"?
Thanks for your time

Statistics: Posted by Rlow1937 — Sat Apr 27, 2024 12:47 am



Viewing all articles
Browse latest Browse all 3582

Trending Articles