Skip to content

Commit

Permalink
added a script to toggle the pin, so we can test the server when phys…
Browse files Browse the repository at this point in the history
…ically away from it
  • Loading branch information
ric2b committed Jul 13, 2015
1 parent 36cc6ed commit 8692660
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Empty file modified GPIOtest.py 100755 → 100644
Empty file.
16 changes: 16 additions & 0 deletions GPIOtoggle
@@ -0,0 +1,16 @@
#!/bin/bash

echo "argument 'setup' -> use after a reboot"
echo "any other argument toggles the pin"
echo ""

if [ "$1" == "setup" ]
then
echo "4" > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio4/direction
else
value=$(cat /sys/class/gpio/gpio4/value)
echo "$((value==0))" > /sys/class/gpio/gpio4/value
echo -n "new pin value: "
cat /sys/class/gpio/gpio4/value
fi

0 comments on commit 8692660

Please sign in to comment.