From 598e84603f8558e8b19a847ccf7e8bdad2a6dbf4 Mon Sep 17 00:00:00 2001 From: KenwoodFox Date: Wed, 14 Jul 2021 12:20:35 -0400 Subject: [PATCH] Update requirements and makefile to build crawler companion software --- crawler_software/arduino/Makefile | 13 ------- .../arduino/crawler_slave/Makefile | 38 +++++++++++++++++++ .../arduino/crawler_slave/requirements.txt | 1 + 3 files changed, 39 insertions(+), 13 deletions(-) delete mode 100644 crawler_software/arduino/Makefile create mode 100644 crawler_software/arduino/crawler_slave/Makefile create mode 100644 crawler_software/arduino/crawler_slave/requirements.txt diff --git a/crawler_software/arduino/Makefile b/crawler_software/arduino/Makefile deleted file mode 100644 index ea0c07b..0000000 --- a/crawler_software/arduino/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -# Uses arduin-mk, by Joe - -ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) - - -ARDUINO_DIR = /usr/share/arduino -ARDUINO_PORT = /dev/ttyAMCM* -BOARD_TAG = atmega328old #atmega328 or this? nano328 -USER_LIB_PATH = $(ROOT_DIR)/libraries -ARDUINO_LIBS = - - -include /usr/share/arduino/Arduino.mk diff --git a/crawler_software/arduino/crawler_slave/Makefile b/crawler_software/arduino/crawler_slave/Makefile new file mode 100644 index 0000000..d35a83e --- /dev/null +++ b/crawler_software/arduino/crawler_slave/Makefile @@ -0,0 +1,38 @@ +# A makefile for building the robot's slave software +# Uses arduino-cli +# +# Kitsune Scientific 2021 + +# What board to build for and its core +CORE ?= arduino:avr +FQBN ?= arduino:avr:nano + +# What port to build on +ifndef SERIAL_DEV + ifneq (,$(wildcard /dev/ttyUSB0)) + SERIAL_DEV = /dev/ttyUSB0 + else ifneq (,$(wildcard /dev/ttyACM0)) + SERIAL_DEV = /dev/ttyACM0 + else + SERIAL_DEV = unknown + endif +endif + +all: requirements build upload + +build: crawler_slave.ino + arduino-cli core install $(CORE) + + arduino-cli compile -b $(FQBN) crawler_slave + +upload: + echo "Would install to $(SERIAL_DEV)" + +requirements: + @if [ -e requirements.txt ]; \ + then while read -r i ; do echo ; \ + echo "---> Installing " '"'$$i'"' ; \ + arduino-cli lib install "$$i" ; \ + done < requirements.txt ; \ + else echo "---> MISSING requirements.txt file"; \ + fi diff --git a/crawler_software/arduino/crawler_slave/requirements.txt b/crawler_software/arduino/crawler_slave/requirements.txt new file mode 100644 index 0000000..673f559 --- /dev/null +++ b/crawler_software/arduino/crawler_slave/requirements.txt @@ -0,0 +1 @@ +Servo