Initial commit — Amirine Cosplay Lights
Arduino Uno + WS2812B LED strip controller with a text-based lightshow system. Shows are defined as .txt files (hex color + fade duration per step), converted to PROGMEM headers by convert_all.py, and navigated at runtime via a debounced button (tap/double-tap/hold). BSD 2-Clause license. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
# 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 build upload port clean
|
||||
|
||||
all: build
|
||||
|
||||
## Convert all .txt show files and regenerate shows.h.
|
||||
shows:
|
||||
python converter/convert_all.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) $(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)
|
||||
Reference in New Issue
Block a user