RPi: Difference between revisions
Jump to navigation
Jump to search
Created page with "Setup as output echo "23" > /sys/class/gpio/export echo "out" > /sys/class/gpio/gpio23/direction echo "1" > /sys/class/gpio/gpio23/value echo "0" > /sys/class/gpio/gpio23/value Setup as input echo "23" > /sys/class/gpio/export echo "in" > /sys/class/gpio/gpio23/direction cat /sys/class/gpio/gpio23/value echo "23" > /sys/class/gpio/unexport Or: gpio -g mode 23 out..." |
No edit summary |
||
Line 21: | Line 21: | ||
gpio -g write 23 1 | gpio -g write 23 1 | ||
gpio -g write 23 0 | gpio -g write 23 0 | ||
Network interface with multiple IP's | |||
auto lo | |||
iface lo inet loopback | |||
iface eth0 inet dhcp | |||
auto eth0:0 | |||
iface eth0:0 inet dhcp | |||
auto eth0:1 | |||
iface eth0:1 inet static | |||
address 192.168.1.42 | |||
netmask 255.255.255.0 | |||
allow-hotplug wlan0 | |||
iface wlan0 inet manual | |||
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf | |||
iface default inet dhcp |
Revision as of 19:24, 1 April 2024
Setup as output
echo "23" > /sys/class/gpio/export echo "out" > /sys/class/gpio/gpio23/direction
echo "1" > /sys/class/gpio/gpio23/value echo "0" > /sys/class/gpio/gpio23/value
Setup as input
echo "23" > /sys/class/gpio/export echo "in" > /sys/class/gpio/gpio23/direction
cat /sys/class/gpio/gpio23/value
echo "23" > /sys/class/gpio/unexport
Or:
gpio -g mode 23 out gpio -g write 23 1 gpio -g write 23 0
Network interface with multiple IP's
auto lo iface lo inet loopback iface eth0 inet dhcp auto eth0:0 iface eth0:0 inet dhcp auto eth0:1 iface eth0:1 inet static address 192.168.1.42 netmask 255.255.255.0 allow-hotplug wlan0 iface wlan0 inet manual wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf iface default inet dhcp