Advertisement
5t0ff31

raspi script gpio init

Dec 3rd, 2016
374
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.33 KB | None | 0 0
  1. root@rpi-hum:/home/pi# vim gpio_init.sh
  2. #!/bin/sh
  3. #shafiz 2016-12-04
  4. for port in 5 6
  5.   do
  6.   echo "$port" > /sys/class/gpio/export
  7.   echo "out" >/sys/class/gpio/gpio${port}/direction
  8.   echo "1" >/sys/class/gpio/gpio${port}/value
  9.   chmod 660 /sys/class/gpio/gpio${port}/direction
  10.   chmod 660 /sys/class/gpio/gpio${port}/value
  11. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement