Orange (Armbian) Pi: install the library WiringOP (WiringPi equivalent) [Exclusive Guide]
Bookstore WiringPi which allows to use the connector (GPIO) expansion of the Raspberry PI for been adapted to the Orange Pi . The library source code is available on GitHub at this address https://github.com/zhaolei/WiringOP . The version for Orange Pi takes the name of WiringOP . Many examples are available in the examples directory and show how to use it with a few common expansion cards: PiFace , PiGlow, GertBoard … There are more to test it all!
for this tutorial, I used a Orange Pi Lite (Wi – Fi version) but the method should be applied to all the range (to check for the Orange Pi Zero, which for a connector 26 pins instead of 40). I installed the distribution Armbian (Desktop version).
log on to the user account on which you want to install the library, place you in the directory / home for example, then start the recovery of the source from GitHub.
git clone https://github.com/zhaolei/WiringOP.git b h3 & & cd WiringOP
then we launch the compilation after giving the rights to the script build.]
chmod + x . / build
sudo . / build
run the command gpio readall . In return, you will get the State of each pin. For example in the V column, a 1 means that the output is active, no let’s just after. In the table, there is also the correspondence of each spindle with the GPIO of the Raspberry.
connect an Led on the 29 pin ((PG7) PG7) through a 220Ω resistance, then close the circuit by returning to a PIN GND (0V in the table above).
Let’s start by changing the output of the 29 PIN mode (GPIO21).
now, if you want to turn on the led
now look at the State of the PIN by a gpio readall .
in column V make exit 29, the PIN is in State 1.
to turn it off, then off
open a new script called testgpio.sh for example and then paste the code below. Save it with Ctrl + X then Y
gpio mode 29 out
while true ; do
gpio write 29 we
gpio write 29 off
this script done flashing the Led (a pulse per second) until we stop the script to the keyboard (Ctrl + X).
make the script executable
that is, you can now use the GPIO of Orange Pi in your scripts