I am currently working with a Raspberry Pi (Model B+) and have some experience with Arduino (and it's derivates).
Now, there are three Libs for GPIO access with Python for the Pi:
- WiringPi (WiringPi2)
- RPi.GPIO
- RPIO
What are the advantages/disatvantages of each, since I cannot find a comprehensive list.
RPIO (latest update to version 0.10.1 2 years ago according to github) is said to replace RPi.GPIO which is somehow still maintained (latest update to version 0.5.9 2015年01月04日). Furthermore, the latest update to WiringPi2 on github is 7 months ago.
More specifically, the RPIO is said to provide better PWM results (among other things, I'm gonna control a servo) than RPi.GPIO which did a good job so far.
I'd like to work with just one Python GPIO lib.
UPDATE:
I now migrated my whole code to work with the pigpio framework which works like a charme.
-
1It looks like the most used is RPi.GPIO. import RPi.GPIO as GPIO For further instrutions, see RPi.GPIO Wikithekiwi5000– thekiwi50002015年02月05日 20:37:29 +00:00Commented Feb 5, 2015 at 20:37
-
related: raspberrypi.stackexchange.com/a/85798/19949Ghanima– Ghanima ♦2018年07月09日 20:38:53 +00:00Commented Jul 9, 2018 at 20:38
1 Answer 1
I tried RPi.GPIO for a PWM LED strip and found I could not get a stable refresh. You might not notice it so much with a servo but it was very evident with the LEDs. I resigned myself to using hardware for PWM on RPi.
-
2With RPi.GPIO, LEDs can be dimmed, but the servo was stuttering so I use RPIO for that (RPIO uses DMA to create a nice PWM-signal/square-wave). Currenty working with RPi.GPIO for "regular" GPIO access and RPIO for PWM, since migration isn't complete yet.RichyGuitar– RichyGuitar2015年02月11日 13:07:53 +00:00Commented Feb 11, 2015 at 13:07