Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Set the pin for input
- gpio -g mode 4 up
- gpio -g mode 4 in
- # Set the variable through command substitution
- b=$(gpio -g read 4)
- # Echo the value to the console
- echo "$b"
Advertisement
Add Comment
Please, Sign In to add comment