You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(firmware): replace magic numbers with constants
Replace all hardcoded numbers with named constants for better maintainability:
**New constants:**
- NUM_FRAMES (8) - Number of frames per animation
- BYTES_PER_COLOR (3) - RGB bytes per color
- Reorganize config into logical sections
**Replacements:**
- NUM_FRAMES_PER_ANIMATION: now calculated as (FPS * ANIMATION_DURATION_SEC)
- Frame offsets: use NUM_LEDS instead of hardcoded 64
- Color offsets: use BYTES_PER_COLOR instead of hardcoded 3
- Loop bounds: use NUM_FRAMES and ANIMATION_DURATION_SEC
- Serial output: use LED_PIN and ANIMATION_DURATION_SEC constants
This makes the code easier to modify (e.g., changing to 16x16 matrix or different FPS) without hunting for magic numbers.
0 commit comments