Created
February 27, 2020 10:54
-
-
Save buzztiaan/dc600e571a6332caae1f5952dfbd046b to your computer and use it in GitHub Desktop.
tank bash controller
This file contains hidden or 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 | |
while true; do | |
read -n 1 key | |
case "$key" in | |
w) | |
echo 'F' > /dev/ttyACM0 | |
;; | |
# s) | |
# echo 'B' > /dev/ttyACM0 | |
# ;; | |
a) | |
echo 'L' > /dev/ttyACM0 | |
;; | |
d) | |
echo 'R' > /dev/ttyACM0 | |
;; | |
4) | |
echo '4' > /dev/ttyACM0 | |
;; | |
5) | |
echo '5' > /dev/ttyACM0 | |
;; | |
6) | |
echo '6' > /dev/ttyACM0 | |
;; | |
7) | |
echo '7' > /dev/ttyACM0 | |
;; | |
8) | |
echo '8' > /dev/ttyACM0 | |
;; | |
9) | |
echo '9' > /dev/ttyACM0 | |
;; | |
s) | |
echo 'S' > /dev/ttyACM0 | |
;; | |
esac | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment