8,367
edits
Changes
→Wiringop-Python installation method
# First install the dependency package
::{| class="wikitable" style="width:800px;"
|-
|
root@orangepi:~# '''sudo apt-get update'''
root@orangepi:~# '''sudo apt-get -y install git swig python3-dev python3-setuptools'''
|}
<ol start="2" style="list-style-type: decimal;">
<li>Then use the following command to download the source code of wiringOP-Python</li>{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| </olbig>'''Note that the following git clone--recursivee 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 an error due to network problems.'''
'''If there is a problem with the download code from GitHub, you can use the Wiringop-Python source code that comes with the Linux image directly, and the storage location is:/usr/src/wiringOP-Python'''</big>
|}
{| class="wikitable" style="width:800px;"
|-
|
root@orangepi:~# '''git clone --recursive https://github.com/orangepi-xunlong/wiringOP-Python -b next'''
root@orangepi:~/wiringOP-Python# '''git submodule update --init --remote'''
|}</ol>
<ol start="3" style="list-style-type: decimal;">
<li>Then use the following command to compile wiringOP-Python and install it into the Linux system of the development board</li></ol>{| class="wikitable" style="width:800px;" |-|
root@orangepi:~# '''cd wiringOP-Python'''
root@orangepi:~/wiringOP-Python# '''sudo python3 setup.py install'''
|}</ol>
<ol start="4" style="list-style-type: decimal;">
<li>Then enter the following command. If there is a help information output, it means that Wiringop-Python is successfully installed. Press the '''q''' key to exit the interface of the help information</li></ol>
{| class="wikitable" style="width:800px;"
|-
|
root@orangepi:~/wiringOP-Python# '''python3 -c "import wiringpi; 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.
|}
</ol>
<ol start="5" style="list-style-type: decimal;">
<li><p>Test whether the Wiringop-Python is installed successfully under the Python command line is shown below: </p>
<ol style="list-style-type: lower-alpha;">
<li>First use the Python3 command to enter the command line mode of Python3</li></ol>
</li></ol>
{| class="wikitable" style="width:800px;" |-|
root@orangepi:~# '''python3'''
|}</ol>
<ol start="2" style="list-style-type: lower-alpha;">
<li>Then import the Python module of WiringPi</li></ol>{| class="wikitable" style="width:800px;" |-|
>>> '''import wiringpi;'''
|}</ol>
<ol start="3" style="list-style-type: lower-alpha;">
<li>Enter the following command to view the help information of Wiringop-Python, and press the '''q''' key to exit the interface of the help information</li></ol>{| class="wikitable" style="width:800px;" |-|
>>> '''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.
CLASSES
:builtins.object
::GPIO
::I2C
::Serial
::nes
:class GPIO(builtins.object) :| GPIO(pinmode=0) :|
>>>
|}
</ol>
<span id="pin-gpio-port-test-1"></span>
=== 40pin GPIO port test ===