Open main menu

Wiki-Orange Pi β

Changes

Orange Pi CM4

325 bytes added, 17:39, 18 September 2023
How to install wiringOP
== How to install wiringOP ==
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''Note that wiringOP is already pre-installed in the Linux image released by Orange Pi. Unless the wiringOP code is updated, there is no need to re-download, compile and install it, 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>
<div class="figure">
[[File:cm4-img256.png|center]]
</div>
 
'''WiringOP currently mainly adapts to the functions of setting GPIO port input and output, setting GPIO port output high and low levels, and setting pull-up and pull-down resistors. Functions such as hardware PWM cannot be used.'''
|}
<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 Orange Pi CM4 needs to download the code of 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>
<div class="figure">
<span id="pin-interface-gpio-i2c-uart-spi-and-pwm-test"></span>
 
== 40pin interface GPIO, I2C, UART, SPI and PWM test ==