How do I set the pullup using /sys/class/gpio/gpio$PIN/
echo 1 > /sys/class/gpio/gpio$PIN/value
does not seem to work.
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
I'm not sure that you can set the internal pull-up/pull-downs via the sysfs interface. I have never done so, but I don't often use sysfs.
From the command line there are many methods. The following examples assume Broadcom gpio 4.
pigs pud 4 u # up pigs pud 4 d # down pigs pud 4 o # off
raspi-gpio set 4 pu # up raspi-gpio set 4 pd # down raspi-gpio set 4 pn # off
gpio -g mode 4 up # up gpio -g mode 4 down # down gpio -g mode 4 tri # off