Files
Amirine_Cosplay_Lights/Makefile
T
bgrolleman a96f378c9c Add triple-tap lights-off and fix LED pin to D5
- Triple tap turns off LEDs; any subsequent tap or hold resumes the current show
- Change LED_DATA_PIN default from 6 to 5 across config, docs, and wiring diagram
- Fix Makefile upload to pass --input-dir so it uses the pre-built binary

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-24 13:20:36 +02:00

58 lines
1.8 KiB
Makefile

# Amirine Cosplay Lights — Build & Upload
# SPDX-License-Identifier: BSD-2-Clause
#
# Usage:
# make shows — convert all .txt shows and regenerate shows.h
# make build — compile the sketch
# make upload — convert shows, compile, and upload (auto-detects port)
# make upload PORT=/dev/ttyUSB1 — upload to a specific port
# make port — list connected Arduino-compatible devices
# make clean — remove build artifacts
SKETCH := arduino/cosplay_lights
FQBN := arduino:avr:uno
BUILD_DIR := build
# Auto-detect the first connected Arduino Uno port.
# Override on the command line: make upload PORT=/dev/ttyUSB1
PORT ?= $(shell arduino-cli board list 2>/dev/null | awk '/arduino:avr:uno/{print $$1}' | head -1)
# ---- Targets -----------------------------------------------------------
.PHONY: all shows simulate build upload port clean
all: build
## Convert all .txt show files and regenerate shows.h.
shows:
python converter/convert_all.py
## Preview shows in the terminal without hardware.
simulate:
python converter/simulate.py
## Compile the sketch.
build:
arduino-cli compile --fqbn $(FQBN) --build-path $(BUILD_DIR) $(SKETCH)
## Convert shows, compile, and upload to the Arduino.
upload: shows build
@if [ -z "$(PORT)" ]; then \
echo ""; \
echo " No Arduino found. Plug in the USB cable and try again,"; \
echo " or specify the port manually: make upload PORT=/dev/ttyUSB0"; \
echo ""; \
exit 1; \
fi
arduino-cli upload --fqbn $(FQBN) --port $(PORT) --input-dir $(BUILD_DIR) $(SKETCH)
@echo ""
@echo " Uploaded to $(PORT). The show starts immediately."
## List connected Arduino-compatible devices.
port:
@arduino-cli board list
## Remove build artifacts.
clean:
rm -rf $(BUILD_DIR)