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>
This commit is contained in:
2026-05-24 13:20:36 +02:00
parent ebf01531c5
commit a96f378c9c
5 changed files with 21 additions and 11 deletions
+2 -1
View File
@@ -18,7 +18,7 @@
// -- Wiring --------------------------------------------------
// Pin on the Arduino connected to the strip's DIN (data-in).
#define LED_DATA_PIN 6
#define LED_DATA_PIN 5
// Clock pin — only needed for APA102/SK9822 strips.
// #define LED_CLOCK_PIN 7
@@ -37,6 +37,7 @@
// Uses INPUT_PULLUP — no external resistor needed.
// 1 tap → next show
// 2 taps → previous show
// 3 taps → lights off (any tap/hold resumes)
// hold → reset to show 0 (blue breath)
#define BUTTON_PIN 2
@@ -5,6 +5,7 @@
* A single button navigates between shows:
* 1 tap — next show
* 2 taps — previous show
* 3 taps — lights off (any tap or hold resumes)
* hold — reset to show 0 (blue breath)
*
* To add or update shows:
@@ -28,8 +29,10 @@ static ShowDef s_show; // PROGMEM cache for the active sh
static uint16_t s_step_index = 0;
static uint32_t s_step_start = 0;
static CRGB s_from_color = CRGB::Black;
static bool s_lights_off = false;
static void load_show(uint8_t index) {
s_lights_off = false;
s_show_index = index;
s_show = read_show_def(&SHOWS[index]);
s_step_index = 0;
@@ -76,6 +79,7 @@ void setup() {
s_button.setPressMs(800);
s_button.attachClick([]() { load_show((s_show_index + 1) % SHOW_COUNT); });
s_button.attachDoubleClick([]() { load_show((s_show_index + SHOW_COUNT - 1) % SHOW_COUNT); });
s_button.attachMultiClick([]() { if (s_button.getNumberClicks() == 3) { s_lights_off = true; leds_apply_color(CRGB::Black); leds_show(); } });
s_button.attachLongPressStart([]() { load_show(0); });
}
@@ -87,6 +91,8 @@ void loop() {
if (now - s_last_frame < 16) return;
s_last_frame = now;
if (s_lights_off) return;
Step step = read_step(&s_show.steps[s_step_index]);
CRGB to = CRGB(step.r, step.g, step.b);
uint8_t t8 = step_progress(step, now);