8,367
edits
Changes
→How to set the pull-down resistance of pin GPIO port
</div></li>
<li><p>First, you need to set the GPIO port to the input mode, and the third parameter needs to be the serial number of the wPi corresponding to the input pin</p>
{| class="wikitable" style="width:800px;" |-|<p>root@orangepi:~/wiringOP# '''gpio mode <span style="color:#FF0000">2 </span> in'''</p>|}</li>
<li><p>After setting to input mode, execute the following command to set the GPIO port to pull-up mode</p>
{| class="wikitable" style="width:800px;" |-|<p>root@orangepi:~/wiringOP# '''gpio mode <span style="color:#FF0000">2 </span> up'''</p>|}</li>
<li><p>Then enter the following command to read the level of the GPIO port, if the level is 1, it means that the pull-up mode is set successfully</p>
{| class="wikitable" style="width:800px;" |-|<p>root@orangepi:~/wiringOP# '''gpio read <span style="color:#FF0000">2</span>'''</p><p>'''1'''</p>|}</li>
<li><p>Then execute the following command to set the GPIO port to pull-down mode</p>
{| class="wikitable" style="width:800px;" |-|<p>root@orangepi:~/wiringOP# '''gpio mode <span style="color:#FF0000">2 </span> down'''</p>|}</li>
<li><p>Then enter the following command to read the level of the GPIO port, if the level is 0, the pull-down mode is set successfully</p>
{| class="wikitable" style="width:800px;" |-|<p>root@orangepi:~/wiringOP# '''gpio read <span style="color:#FF0000">2</span>'''</p><p>'''0'''</p>|}</li></ol>
<span id="pin-spi-test"></span>
=== 40 pin SPI test ===