The GPIO pin is shown in the figure below.

GPIO can be controlled by the following commands, such as gpio14:

Apply for GPIO

#echo 14 > /sys/class/gpio/export

Set as output

#echo out > /sys/class/gpio/gpio14/direction

Set as input

#echo in > /sys/class/gpio/gpio14/direction

Output high level

#echo 1 > /sys/class/gpio/gpio14/value

Output low level

#echo 0 > /sys/class/gpio/gpio14/value

Get input level (0: low level, 1: high level)

#cat /sys/class/gpio/gpio14/value
文档更新时间: 2021-07-30 17:06   作者:Aeeditor