mirror of
https://github.com/FunKey-Project/FunKey-OS.git
synced 2026-05-07 13:23:29 +02:00
19 lines
324 B
Bash
Executable File
19 lines
324 B
Bash
Executable File
#!/bin/sh
|
|
|
|
if [ $# -ne 2 ]; then
|
|
echo "ERROR Wrong number of arguments $#"
|
|
exit 1
|
|
fi
|
|
pin=$(gpiofind "${1}")
|
|
if [ $? -ne 0 ]; then
|
|
echo "ERROR Unknown GPIO ${1}"
|
|
exit 1
|
|
fi
|
|
case ${2} in
|
|
0) value=${2};;
|
|
1) value=${2};;
|
|
*) echo "ERROR Bad value ${2}"; exit 1;;
|
|
esac
|
|
gpioset ${pin}=${value}
|
|
echo "OK"
|