树莓派4B GPIO输入问题

树莓派4B,系统是2019-06-20-raspbian-buster
这个系统很奇怪,GPIO的输入需要去配置/boot/config.txt
同样我使用1.44LCD的时候,按键都是不可使用,也就是无法配置上拉输入
http://www.waveshare.net/shop/1.44inch-LCD-HAT.htm

于是查看树莓派官方手册,有说到:
https://www.raspberrypi.org/documentation/configuration/config-txt/gpio.md
ip - Input
op - Output
a0-a5 - Alt0-Alt5
dh - Driving high (for outputs)
dl - Driving low (for outputs)
pu - Pull up
pd - Pull down
pn/np - No pull

Select Alt2 for GPIO pins 0 to 27 (for DPI24)

gpio=0-27=a2

Set GPIO12 to be an output set to 1

gpio=12=op,dh

Change the pull on (input) pins 18 and 20

gpio=18,20=pu

Make pins 17 to 21 inputs

gpio=17-21=ip

于是,打开config.txt:
sudo vi /boot/config.txt
在最后加入:
gpio=6,19,5,26,13,21,20,16=pu

你可能感兴趣的:(树莓派)