EasyManua.ls Logo

ORANGE Pi 3B - 40 Pin SPI Test

ORANGE Pi 3B
366 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
204
>>> import wiringpi
>>> from wiringpi import GPIO
c. Then set the GPIO port as the output mode. The first parameter of the pinMode
function is the serial number of the wPi corresponding to the pin, and the second
parameter is the GPIO mode.
>>> wiringpi.wiringPiSetup()
0
>>> wiringpi.pinMode(2, GPIO.OUTPUT)
d. Then set the GPIO port to output low level. After setting, you can use a
multimeter to measure the voltage value of the pin. If it is 0v, it means that the
low level is set successfully.
>>> wiringpi.digitalWrite(2, GPIO.LOW)
e. Then set the GPIO port to output a high level. After setting, you can use a
multimeter to measure the voltage value of the pin. If it is 3.3v, it means that the
high level is set successfully.
>>> wiringpi.digitalWrite(2, GPIO.HIGH)
4) The method of wiringOP-Python setting GPIO high and low levels in python code can
refer to the blink.py test program in the examples below. The blink.py test program will
set the voltage of all GPIO ports in the 40 pins of the development board to change
continuously.
root@orangepi:~/wiringOP-Python# cd examples
root@orangepi:~/wiringOP-Python/examples# ls blink.py
blink.py
root@orangepi:~/wiringOP-Python/examples# python3 blink.py
3.17.3. 40pin SPI test
1) From the schematic diagram of the 40pin interface, the SPI available for Orange Pi 3B
is spi3

Table of Contents