Created
May 12, 2022 14:55
-
-
Save szampardi/b732b47900ca8367e3e285333715e7ed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -ex | |
_gpio="${1}" | |
_direction="${2:-out}" | |
if [[ ! -d /sys/class/gpio/gpio"${_gpio}" ]]; then | |
echo "${_gpio}" >/sys/class/gpio/export | |
fi | |
echo "${_direction}" >/sys/class/gpio/gpio"${_gpio}"/direction | |
echo "0" >/sys/class/gpio/gpio"${_gpio}"/value | |
sleep 4 | |
echo "1" >/sys/class/gpio/gpio"${_gpio}"/value | |
echo "${_gpio}" >/sys/class/gpio/unexport |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(4/out for SIM868 thingies)