Answers:
是的,所有B +的GPIO引脚都有内部上拉或下拉电阻,可通过您的代码进行控制。
上拉最小为50K –最大65K。下拉最小为5万–最大为6万。
从PI4J 文档中的用法示例:
// provision gpio pin #02 as an input pin with its internal pull down resistor enabled
// (configure pin edge to both rising and falling to get notified for HIGH and LOW state
// changes)
GpioPinDigitalInput myButton = gpio.provisionDigitalInputPin(RaspiPin.GPIO_02, // PIN NUMBER
"MyButton", // PIN FRIENDLY NAME (optional)
PinPullResistance.PULL_DOWN); // PIN RESISTANCE (optional)