added in GPIO led functionality

This commit is contained in:
Dave
2018-10-11 18:57:23 +01:00
parent f13802a62b
commit 56491b7ab0
3 changed files with 106 additions and 6 deletions

25
scripts/blink Normal file
View File

@@ -0,0 +1,25 @@
#!/bin/bash
source ./gpio
function blink()
{
local pin=$1
local speed=$2
while :
do
gpio write $pin 1
sleep $speed
gpio write $pin 0
sleep $speed
done
}
# Just invoke our function if the script is called directly
if [ "$BASH_SOURCE" == "$0" ]; then
gpio mode $1 out
blink $@
fi