From c02c150339a3dd86b03b934c6e356f4497e49807 Mon Sep 17 00:00:00 2001 From: Marcus Date: Sat, 15 Jun 2024 01:02:44 +0200 Subject: [PATCH] add small helper script cangrow.sh --- cangrow.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 cangrow.sh diff --git a/cangrow.sh b/cangrow.sh new file mode 100755 index 0000000..7cce144 --- /dev/null +++ b/cangrow.sh @@ -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