I recently bought myself a raspberry pi 5 and am learning how to work with the gpio pins. The gpio pins require a library to control them. These library’s that are compatible with the Raspberry Pi 5 are the GPIOZERO and gpiod libraries but I find the GPIOZERO library to be too unintuitive so I prefer the gpiod library. While using the gpiod library, I found that it doesn’t support internal pull up/down resistors, nor pwm. Although I could just use external pull up resistors, it would be a lot more efficient to use internal ones. I’ve tried this so far:
import gpiod
Switch = 17
chip = gpiod.Chip('gpiochip4')
Switchline = chip.get_line(Switch)
Switchline.request(consumer="MYDEVICE", type=gpiod.LINE_REQ_DIR_OUT)
yourline.set_value(1)
chip = gpiod.Chip('gpiochip4')
Switchline = chip.get_line(Switch)
Switchline.request(consumer="MYDEVICE", type=gpiod.LINE_REQ_DIR_IN)
Value = Switchline.get_value()
print(Value)
This was unsuccessful due to the line already being set as an output, and it wouldn’t let me change it. Does anyone know of any other ways I could enable an internal pull up resistor into my code?