Created
August 16, 2012 10:24
-
-
Save lrvick/3369097 to your computer and use it in GitHub Desktop.
Send 1hz pulse to all Raspberry Pi GPIO pins for testing, using bash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
pins=( 4 25 24 23 22 21 18 17 ) | |
for pin in "${pins[@]}"; do | |
echo $pin > /sys/class/gpio/export | |
echo "out" > /sys/class/gpio/gpio${pin}/direction | |
sleep 0.1 | |
done | |
while true; do | |
for pin in "${pins[@]}"; do | |
echo "1" > /sys/class/gpio/gpio${pin}/value #LED on | |
done | |
sleep 1 # sleep 1 sec | |
for pin in "${pins[@]}"; do | |
echo "0" > /sys/class/gpio/gpio${pin}/value #LED on | |
done | |
sleep 1 # sleep 1 sec | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment