add small helper script cangrow.sh

This commit is contained in:
Marcus 2024-06-15 01:02:44 +02:00
parent f696d58212
commit c02c150339

28
cangrow.sh Executable file
View file

@ -0,0 +1,28 @@
#!/bin/bash
#
TTY=/dev/ttyUSB0
function help() {
echo "$0 [build|upload|monitor]"
exit 1
}
test -z $1 && help
case $1 in
b|build)
test -d build || mkdir build
~/.local/bin/arduino-cli --no-color compile -b esp8266:esp8266:d1_mini_clone "Arduino/CanGrow/CanGrow.ino" --output-dir build/
;;
u|upload)
~/.local/bin/arduino-cli --no-color compile -v -b esp8266:esp8266:d1_mini_clone -u -p $TTY "Arduino/CanGrow/CanGrow.ino"
;;
m|mon|monitor)
~/.local/bin/arduino-cli monitor -c baudrate=115200 -p $TTY
;;
*)
help
;;
esac