So question is: Does all Raspberrys GPIO have a internal pull-up/pull-down resistor which can be enabled from program, in my case Java language with PiJ4?
I have Raspberry Model B+.
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It only takes a minute to sign up.Sign up to join this community
Yes, all of the B+'s GPIO pins have internal pull-up or pull-down resistors that can be controlled from your code.
Pull-up is 50K min – 65K max. Pull-down is 50K min – 60K max.
Example usage frm the PI4J documentation:
// 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)