Commit Graph

19 Commits

Author SHA1 Message Date
e516b49eb8 Add segmented_movement pattern with alternating forward/backward movement
- Add n4 parameter support to main.py ESP NOW receiver
- Implement segmented_movement pattern with configurable parameters:
  * n1: segment length (number of LEDs per segment)
  * n2: spacing between segments
  * n3: forward movement speed (positions per beat)
  * n4: backward movement speed (positions per beat)
- Pattern alternates between forward and backward movement each beat
- If only n3 or n4 is set, moves in that direction every beat
- Draws repeating segments with spacing across entire LED strip
- Add Pipfile script to run dev.py directly with arguments
2025-10-03 19:56:24 +13:00
355d113e32 Fix rainbow pattern synchronization in LED bar
- Use controller's step for synchronization instead of internal step counter
- Rainbow pattern now syncs with controller timing like n_chase pattern
- Prevents rainbow from running independently and out of sync
- Uses beat_index % 256 for full color wheel cycling
2025-09-19 01:29:48 +12:00
d715af4344 Fix n_chase pattern to properly chase through all LED positions
- Replace oscillating behavior with proper chasing movement
- Use pattern_step for internal tracking instead of controller's step
- Calculate position relative to chase head: (i - pattern_step) % num_leds
- Chase head moves through all LED positions with n3 step multiplier
- n1 controls width of lit chase segment
2025-09-19 00:22:25 +12:00
67c4a1a6f6 Update LED bar to handle message type field
- Process 't' field to distinguish between beat ('b') and update ('u') messages
- Beat messages: execute pattern immediately using current parameters
- Update messages: only update parameters, don't execute pattern
- Maintains backward compatibility with default to beat if 't' not specified
- Enables proper synchronization between controller and bars
2025-09-18 22:10:23 +12:00
748ad4b507 Add n3 step rate functionality to patterns 2025-09-18 20:35:21 +12:00
1275d60aaa Make alternating pattern timing independent of n1
- Changed alternating pattern to return delay/2 instead of delay
- Each phase now lasts delay/2, making full cycle equal to delay
- n1 now only controls ON/OFF segment width, not timing
2025-09-18 19:11:35 +12:00
8cfb3e156b patterns: add rainbow, specto, and radiate (out then dark-out)
radiate: origins every n1, step by delay, stop when full, dark wave outward, ensure strip off at end, run once

alternating: use n1 as ON width and n2 as OFF width; phase via self.step

pulse: attack (n1), hold (delay), decay (n2); stop at end

tests: add specto sweep (n1_sequence) and radiate demo; include n index per message; use nested {name:{...}} schema; support iterations/repeat-delay
2025-09-16 22:28:51 +12:00
d599af271b patterns: alternating uses n1 (on) and n2 (off); ensure visible ON color; return delay; phase via self.step
test: WS client sends nested {name:{...}}; add iterations and repeat-delay; include n per message; use n1/n2 for alternating
2025-09-16 21:22:47 +12:00
93560a253e patterns: fix blink timing; slow alternating; unify self-test with absolute tick scheduling 2025-09-15 14:12:43 +12:00
80d5a66fab patterns: centralize timing in tick(); remove selected-delay coupling; update self-test to use per-config durations 2025-09-15 12:56:57 +12:00
44cb35d1aa Split into pattern and low level methods 2025-09-05 23:29:18 +12:00
50545e3170 Remove random patterns 2025-08-03 19:29:10 +12:00
87fc74bb51 Add flicker pattern 2025-07-12 10:21:43 +12:00
279416cded Add set_pattern_step 2025-06-19 19:03:22 +12:00
1989f6f5c9 Switch to list for colors 2025-06-12 21:29:31 +12:00
3d0078f118 Update leds straight away after a sync 2025-06-02 00:18:25 +12:00
8902adf18c Fix color transition 2025-05-24 13:09:28 +12:00
1aa36a3a63 Disable 1 step forward 2 back 2025-02-06 22:19:55 +13:00
c3fb9566da Initial commit 2025-01-18 16:26:30 +13:00