Changes

Jump to: navigation, search

Orange Pi Zero 3

499 bytes added, 15:29, 11 July 2023
How to install wiringOP-Python
<ol style="list-style-type: decimal;">
<li><p>First install the dependency package</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>root@orangepi:~# '''sudo apt-get update'''</p>
<p>root@orangepi:~# '''sudo apt-get -y install git swig python3-dev python3-setuptools'''</p>|}</li>
<li><p>Then use the following command to download the source code of wiringOP-Python</p>
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''Note that the following git clone --recursive command will automatically download the source code of wiringOP, because wiringOP-Python depends on wiringOP. Please make sure that the download process does not report errors due to network problems.'''</p>  <p>'''If you have problems downloading the code from GitHub, you can directly use the wiringOP-Python source code that comes with the Linux image, and the storage location is: /usr/src/wiringOP-Python'''</p></big>|}{| class="wikitable" style="width:800px;" |-|
<p>root@orangepi:~# '''git clone --recursive https://github.com/orangepi-xunlong/wiringOP-Python -b next'''</p>
<p>root@orangepi:~# '''cd wiringOP-Python'''</p>
<p>root@orangepi:~/wiringOP-Python# '''git submodule update --init --remote'''</p>|}</li>
<li><p>Then use the following command to compile wiringOP-Python and install it into the Linux system of the development board</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>root@orangepi:~# '''cd wiringOP-Python'''</p>
<p>root@orangepi:~/wiringOP-Python# '''python3 generate-bindings.py &gt; bindings.i'''</p>
<p>root@orangepi:~/wiringOP-Python# '''sudo python3 setup.py install'''</p>|}</li>
<li><p>Then enter the following command, if there is help information output, it means that wiringOP-Python is installed successfully, press the '''q''' key to exit the help information interface</p></li></ol>
{| class="wikitable" style="width:800px;"
|-
|
root@orangepi:~/wiringOP-Python# '''python3 -c &quot;import wiringpi; help(wiringpi)&quot;'''
Help on module wiringpi:
 
NAME
:wiringpi 
DESCRIPTION
: # This file was automatically generated by SWIG (http://www.swig.org).
: # Version 4.0.2
: #
: # Do not make changes to this file unless you know what you are doing--modify
: # the SWIG interface file instead.|}
<ol start="5" style="list-style-type: decimal;">
</li></ol>
{| class="wikitable" style="width:800px;"
|-
|
root@orangepi:~# '''python3'''
|}
<ol start="2" style="list-style-type: lower-alpha;">
<li>Then import the python module of wiringpi</li></ol>
{| class="wikitable" style="width:800px;"
|-
|
&gt;&gt;&gt; '''import wiringpi;'''
|}
<ol start="3" style="list-style-type: lower-alpha;">
<li>Finally, enter the following command to view the help information of &gt; wiringOP-Python, and press the q key to exit the help information &gt; interface</li></ol>
{| class="wikitable" style="width:800px;"
|-
|
&gt;&gt;&gt; '''help(wiringpi)'''
Help on module wiringpi:
 
NAME
:wiringpi 
DESCRIPTION
: # This file was automatically generated by SWIG (http://www.swig.org).
: # Version 4.0.2
: #
: # Do not make changes to this file unless you know what you are doing--modify : # the SWIG interface file instead.
# the SWIG interface file instead.
CLASSES
:builtins.object
::GPIO
::I2C
::Serial
::nes
class GPIO(builtins.object)
:class GPIO(builtins.object) :| GPIO(pinmode=0) :|
|
&gt;&gt;&gt;
|}
<span id="pin-gpio-port-test-1"></span>
 
=== 26pin GPIO port test ===

Navigation menu