How can gpio be used to control execution?
The following works for showing the input value of gpio63
echo 63 > /sys/class/gpio/export
echo in > /sys/class/gpio/gpio63/direction
cat /sys/class/gpio/gpio63/value
But I’ve tried a number of things like
while [ /sys/class/gpio/gpio63/value = "1" ]
do
sleep 1
done
without success.
You’re comparing the string “/sys/class/gpio/gpio63/value” to the string “1”. They’ll never be equal. If you’re looking for a “1” as the content of the file named “/sys/class/gpio/gpio63/value” you should say