I am attempting to rewrite a bit of code that used gpiozero for a Raspberry Pi that no longer works on the Raspberry Pi 5 due to the GPIO changes in the Raspi 5. I need it to be backwards compatible to possibly run on our Raspi 2's that we were using, so the gpiod lib seems like the best choice. However, example code here (specifically using the get line value example) and here but the ACTIVE value doesn't appear to change when I push the button. These are the same buttons that worked using gpiozero, so I'm assuming I'm doing something wrong in the api implementation. However, I have no baseline to check from because I cannot find any working example code that uses a modern implementation of this library. Maybe it doesn't exist? That is my question:
Does anyone know of any or could anyone write working example code for a button that works with the modern gpiod library that I could reference? If not, could anyone suggest where else I might look besides the "active" value of a pin? Maybe I'm looking at the wrong value and just don't know it?
Would really appreciate any direction that anyone would be willing to offer in this case.
Thank you in advance!
EDIT: I did get my LED's switched over, so I know at least what I'm doing with LED's is working. Thanks to the example LED code here for pointing the way. Buttons don't seem to work this way, however.