lzb Posted April 25, 2018 Posted April 25, 2018 I'm looking at GPIOs and I'm not sure - can I buy an "old" (26 pin) Raspberry Pi gpio adapter-breadboard-cable package (like this one) and use it on Orange Pi Zero GPIOs as on Raspberry Pi GPIOs?
chwe Posted April 25, 2018 Posted April 25, 2018 why not? GPIO is GPIO. the only thing is to find a GPIO library which fits best to your use-case. @Larry Bank provides a C Library with python and Java bindings (with a lot of examples, sysFS based). https://github.com/bitbank2/ArmbianIO I maintained a fork of pyA20 (Python based, pyGPIO /dev/mem based, needs root to execute programs) with multiple boards, but cause he's a way more active than me, I suggest to use his library as long as you don't need 'maximum speed' to toggle pins. @sgjava provides bindings for a libgpiod based library (needs mainline kernel) with python and java bindings And there are other libraries 'in the wild' which might or might not work for your board.
Larry Bank Posted April 25, 2018 Posted April 25, 2018 Yes, the physical pins line up with the RPI original 26-pin GPIO. Remember that the connector is on the "other side" of the board with respect to the RPI way of doing it.
sgjava Posted April 26, 2018 Posted April 26, 2018 @chwe I just did a quick test using User Space IO which uses liggpiod 1.1. On a NanoPi Duo I was able to toggle a pin at 25 KHz (on/off cycle) with Python. If you need speed or precision I'd go with hardware PWM which User Space IO supports.
lzb Posted April 26, 2018 Author Posted April 26, 2018 13 hours ago, Larry Bank said: Yes, the physical pins line up with the RPI original 26-pin GPIO. Remember that the connector is on the "other side" of the board with respect to the RPI way of doing it. Yeah, I remember from somewhere that OPi has "compatible" GPIO with RPI, but rotated (180 degrees?). (as an important side note - would be nice if pin description on the breadboard adapter fit actual pins - I can live without this or with a piece of paper, but it's usefull to have valid description for kids )
Recommended Posts