mirror of
https://github.com/FunKey-Project/FunKey-OS.git
synced 2025-12-12 15:48:51 +01:00
23 lines
352 B
Bash
Executable File
23 lines
352 B
Bash
Executable File
#!/bin/sh
|
|
|
|
if [ $# -ne 2 ]; then
|
|
echo "ERROR GPIO ARGS"
|
|
exit 1
|
|
fi
|
|
pin=$(gpiofind "${1}")
|
|
if [ $? -ne 0 ]; then
|
|
echo "ERROR GPIO PIN"
|
|
exit 1
|
|
fi
|
|
case ${2} in
|
|
0) value=${2};;
|
|
1) value=${2};;
|
|
*) echo "ERROR GPIO VALUE"; exit 1;;
|
|
esac
|
|
gpioset ${pin}=${value}
|
|
if [ $? -ne 0 ]; then
|
|
echo "ERROR GPIO I2C"
|
|
else
|
|
echo "OK"
|
|
fi
|