8,367
edits
Changes
→How to install wiringOP
== How to install wiringOP ==
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''Note that wiringOP has been pre-installed in the linux image released by Orange Pi. Unless the code of wiringOP is updated, there is no need to re-download, compile and install, just use it directly.'''
'''The storage path of the compiled wiringOP deb package in orangepi-build is:'''
'''<span style="color:blue">orangepi-build/external/cache/debs/arm64/wiringpi_x.xx.deb</span>'''
'''After entering the system, you can run the gpio readall command. If you can see the following output, it means that wiringOP has been pre-installed and can be used normally.'''</big>
[[File:media/image172.png|575x365px]]
<big>'''wiringOP is currently mainly adapted to the functions of setting GPIO port input and output, setting GPIO port output high and low levels, and setting up and down pull-down resistors. Functions such as hardware PWM are not available.'''</big>|}
<ol style="list-style-type: decimal;">
<li><p>Download the code of wiringOP</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''sudo apt update'''</p>
<p>orangepi@orangepi:~$ '''sudo apt install -y git'''</p>
<p>orangepi@orangepi:~$ '''git clone https://github.com/orangepi-xunlong/wiringOP.git -b next'''</p>
|}{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''Note that the source code needs to download the code of the wiringOP next branch, please don't miss the -b next parameter.'''</p><p>'''If you have problems downloading the code from GitHub, you can directly use the wiringOP source code that comes with the Linux image, and the storage location is: /usr/src/wiringOP.'''</p></big>|}</li>
<li><p>Compile and install wiringOP</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''cd wiringOP'''</p>
<p>orangepi@orangepi:~/wiringOP$ '''sudo ./build clean'''</p>
<p>orangepi@orangepi:~/wiringOP$ '''sudo ./build'''</p>|}</li>
<li><p>Test the output of the gpio readall command as follows</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Pin 31 corresponds to pin 12 of 13pin on the development board</p></li>
<li><p>Pin 33 corresponds to pin 13 of 13pin on the development board</p></li>
<li><p>'''<span style="color:#FF0000">Pins 28, 30, 32, and 34 are empty, please ignore them</span>'''</p>
<p>[[File:media/image172.png|575x365px]]</p></li></ol>
</li></ol>
<span id="pin-interface-gpio-i2c-uart-spi-and-pwm-test"></span>
== 26pin interface GPIO, I2C, UART, SPI and PWM test ==