21 lines
346 B
Plaintext
21 lines
346 B
Plaintext
|
#!/bin/bash
|
||
|
|
||
|
PIN_SALIGHT=11
|
||
|
|
||
|
# init
|
||
|
gpio mode $PIN_SALIGHT output
|
||
|
|
||
|
# command
|
||
|
if [[ "$1" == "on" ]]; then
|
||
|
gpio write $PIN_SALIGHT 1
|
||
|
elif [[ "$1" == "off" ]]; then
|
||
|
gpio write $PIN_SALIGHT 0
|
||
|
elif [[ "$1" == "read" ]]; then
|
||
|
gpio read $PIN_SALIGHT
|
||
|
elif [[ "$1" == "blink" ]]; then
|
||
|
gpio blink $PIN_SALIGHT $2 $3
|
||
|
else
|
||
|
gpio toggle $PIN_SALIGHT
|
||
|
fi
|
||
|
|