Advertisement
metalx1000

Raspberry Pi Based GPIO LED setup

May 8th, 2015
683
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.54 KB | None | 0 0
  1. #Enable GPIO4
  2. echo 4 > /sys/class/gpio/export
  3.  
  4. #Set GPIO4 as output
  5. echo out > /sys/class/gpio/gpio4/direction
  6.  
  7. #turn on
  8. echo 1 > /sys/class/gpio/gpio4/value
  9. #turn off
  10. echo 0 > /sys/class/gpio/gpio4/value
  11.  
  12. #GPIO CHART
  13. http://www.hobbytronics.co.uk/image/data/tutorial/raspberry-pi/gpio-pinout.jpg
  14.  
  15. setup is
  16. GPIO4 to LED Positive #long end
  17. LED Neg to resistor
  18. resistor to Pi Ground (#6 on chart)
  19.  
  20. Photo here:
  21. https://lh3.googleusercontent.com/-kYvTk2dIK20/VUzvUd817KI/AAAAAAAA0ts/RJ6agXa4GkA/w521-h926-no/IMG_20150508_131552815.jpg
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement