AndreaFavero71 / cubotino

Updated scripts and files for CUBOTino autonomous: A small, 3D printed, Rubik’s cube solver robot
Creative Commons Attribution 4.0 International
47 stars 16 forks source link

Remove dependency on RPi.GPIO #18

Closed paul-1 closed 6 months ago

paul-1 commented 6 months ago

Cubotino is already using gpiozero/pigpio for the pwm stuff, just use it for all gpio function. I tested all of the functions of the touch button that I could make out in the code (Solve. Shuffle, Stop)

paul-1 commented 6 months ago

Going to have to come back at this, since the SPI display drivers require it. RPi.GPIO wont work with a pi5 (Not that anyone would want to run a cubotino on a pi5.

AndreaFavero71 commented 6 months ago

If I remember well, the gpiozero is quite underperforming on the interrupts. The only momet this is relevant in Cubotino, is when the robot needs to be stopped quickly, i.e. because of jammed parts/cube while setting things up. It might be that gpiozero is now more efficient, but I haven't further checked.

paul-1 commented 6 months ago

If you use the pigpio pin factory, for the pin control, the interrupt seemed fine.

Gpio is a mess right now, RPi is transitioning to kernel gpio support.

Both RPi.GPIO and pipgpio are obsolete. Neither work on the Pi5. Granted the pi5 is not a target for cubotino....

The st7735 v1.0 driver has already been updated to gpiod and the developer of pigpio has transitioned to lgpio both of which use the kernel libgpiod drivers. Will need to figure this out to transition to newer kernels and Bookworm.

Perhaps I'll just let things settle for a bit and just solve some cubes.

AndreaFavero71 commented 6 months ago

I don't have such a deep knowledge, I'm glad you have it :-)