physical-interface/scripts/compile.sh

19 lines
634 B
Bash
Raw Normal View History

2020-05-06 13:55:34 +02:00
#!/bin/bash
# @author Kevin Veen-Birkenbach [kevin@veen.world]
# This script compiles the program
# set variables
2020-05-06 17:26:39 +02:00
ARDUINO_PATH="/bin/arduino";
2020-05-08 11:11:08 +02:00
MAIN_FILE="$(dirname "$(readlink -f "${0}")")/../main/main.ino"
2020-05-06 13:55:34 +02:00
# test preconditions
if [ ! -f "$ARDUINO_PATH" ]
then
echo "This program expects to find the Arduino IDE in $ARDUINO_PATH, but the file doesn't exist."
echo "Feel free to optimize this script or install Arduino how described under the following url:"
echo "https://askubuntu.com/questions/1025753/how-to-install-latest-arduino-ide"
exit 1;
fi
2020-05-08 11:11:08 +02:00
echo "Compiling $MAIN_FILE..."
bash "$ARDUINO_PATH" --upload "$MAIN_FILE"