More optimize

This commit is contained in:
2026-05-23 10:23:47 +02:00
parent 50df45fd4e
commit 4e5396f231
10 changed files with 165 additions and 30 deletions
+42 -12
View File
@@ -51,7 +51,7 @@ Uses the internal pull-up resistor. No external resistor needed. Pin 2 can be ch
|-------|--------|
| 1 tap | Next show |
| 2 taps | Previous show |
| Hold (~0.8s) | Reset to show 0 (slow blue pulse) |
| Hold (~0.8s) | Reset to show 0 (blue breath) |
### Power warning — read this
@@ -70,9 +70,12 @@ A 60-LED strip at full white = **3.6A** — far more than the Arduino's 5V pin c
## Quick start
### 1. Install the FastLED library
### 1. Install required libraries
Arduino IDE: **Sketch → Include Library → Manage Libraries** → search `FastLED` → Install.
Arduino IDE: **Sketch → Include Library → Manage Libraries**, then install both:
- **FastLED** — LED strip control and color math
- **OneButton** — button debounce and gesture detection
### 2. Configure your hardware
@@ -84,14 +87,28 @@ Edit `arduino/cosplay_lights/config.h`:
### 3. Write or edit show files
Show files live in `converter/shows/`. Four are included:
Show files live in `converter/shows/`. These are included:
| File | Description |
|------|-------------|
| `blue_pulse.txt` | Slow blue breathing — always show 0 (home/reset) |
| `example_fade.txt` | Slow color cycle |
| `example_party.txt` | Fast rainbow flashes |
| `example_pulse.txt` | Red heartbeat |
| File | Description | Mode |
|------|-------------|------|
| `blue_breath.txt` | Slow blue breathing — always show 0 (home/reset) | loop |
| `001_heartbeat.txt` | 3 heartbeats in bright red, then auto-advances to breathing | single |
| `002_breath_red.txt` | Breathing between dark maroon and bright red, 5s cycle | loop |
| `003_solid_red.txt` | Constant deep red | loop |
| `example_fade.txt` | Slow color cycle | loop |
| `example_party.txt` | Fast rainbow flashes | loop |
| `example_pulse.txt` | Red heartbeat | loop |
**Show modes:**
- `loop` — repeats indefinitely until the button is pressed
- `single` — plays once, then automatically advances to the next show
Set the mode with a comment anywhere in the `.txt` file:
```
// mode: single
```
If no mode line is present, the show loops.
**Show file format:**
@@ -133,7 +150,21 @@ make upload PORT=/dev/ttyUSB1 # target a specific port
1. Create a `.txt` file in `converter/shows/` using the format above.
2. Run `make upload` — your new show is automatically included.
The order in which shows appear when cycling through with the button is: `blue_pulse` first, then all others sorted alphabetically by filename.
The order in which shows appear when cycling through with the button is: `blue_breath` first (always show 0), then all others sorted alphabetically by filename. Prefix filenames with numbers (`001_`, `002_`, …) to control order.
---
## File overview
---
## Resources
- [Wokwi](https://wokwi.com/projects/new/arduino-uno) — browser-based Arduino + LED strip emulator, useful for testing shows without hardware
- [tweaking4all — LED strip effects](https://www.tweaking4all.nl/hardware/arduino/adruino-led-strip-effecten/) — reference for animation patterns (sparkle, rainbow, etc.)
- [FastLED color fills reference](https://fastled.io/docs/da/de3/group___color_fills.html)
- [Adafruit LED animation guide](https://learn.adafruit.com/circuitpython-led-animations/basic-animations)
- [htmlcolorcodes.com](https://htmlcolorcodes.com/) — hex color picker for choosing show colors
---
@@ -144,7 +175,6 @@ Amirine_Cosplay_Lights/
├── arduino/cosplay_lights/
│ ├── cosplay_lights.ino — main sketch (upload this)
│ ├── config.h — hardware settings
│ ├── button.h / .cpp — button debounce and event detection
│ ├── led_controller.h / .cpp — LED abstraction layer
│ ├── lightshow_format.h — Step and ShowDef structs
│ ├── shows.h — master show index (regenerated by make shows)