range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
www.orangepi.cn
135
www.xunlong.tv
number of the wPi corresponding to the input pin.
root@orangepi:~/wiringOP# gpio mode 2 out
3) Then set the GPIO port to output a low level. After setting, you can use a multimeter
to measure the voltage value of the pin. If it is 0v, it means the low level is set
successfully.
root@orangepi:~/wiringOP# gpio write 2 0
4) 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 the setting of the high level
is successful.
root@orangepi:~/wiringOP# gpio write 2 1
5) The setting method for other pins is similar. You only need to modify the serial
number of wPi to the serial number corresponding to the pin.
3.19.2. How to set the pull-down resistor of 40 Pin GPIO port
1) The following uses pin No. 7
—
corresponding to GPIO PI13
—
corresponding to wPi
serial number 2
—
as an example to demonstrate how to set the pull-up and pull-down
resistors of the GPIO port.
2) First, you need to set the GPIO port to input mode, and the third parameter needs to be
the serial number of the wPi corresponding to the input pin.
root@orangepi:~/wiringOP# gpio mode 2 in
3) After setting to input mode, execute the following command to set the GPIO port to
pull-up mode.
root@orangepi:~/wiringOP# gpio mode 2 up
4) Then enter the following command to read the level of the GPIO port. If the level is 1,