LED Controller Requirements¶
This document specifies requirements for WS2812 LED strip control, focusing on user-facing functionality and hardware interface.
Document Version: 2.0 Last Updated: 2025-11-12
Overview¶
The LED controller component provides precise control of WS2812 addressable LED strips for visual distance display, supporting individual pixel control and configurable strip lengths.
Functional Requirements¶
Description: The system SHALL support WS2812 addressable LED strips for visual distance display, providing hardware compatibility and initialization. Rationale: WS2812 LEDs are the chosen hardware for distance visualization; system must interface with this specific LED technology. Acceptance Criteria:
Verification: Connect WS2812 strip, verify LEDs respond to basic commands and display expected colors. |
Description: The system SHALL provide the ability to set the color of individual LED pixels within the strip for precise distance visualization. Rationale: Distance display requires lighting specific LEDs at calculated positions; individual control is essential for the application. Acceptance Criteria:
Verification: Set individual LEDs to different colors, verify only targeted LEDs change, test clear all functionality. |
Description: The system SHALL support configurable LED strip lengths to accommodate different hardware deployments and installation requirements. LED count is a user-configurable parameter managed by the configuration system (REQ_CFG_JSON_1). Rationale: Different installations may use varying LED strip lengths; system must be flexible for deployment scenarios. LED count is a user-facing parameter that affects system behavior and visual representation, therefore it belongs in centralized configuration management. Acceptance Criteria:
Verification: Test with different LED counts, verify all configured LEDs are controllable and out-of-range access is prevented. |
Description: The system SHALL display specified RGB colors accurately on WS2812 LEDs for reliable visual feedback to users. Rationale: Color accuracy is essential for distance visualization effectiveness; users must be able to distinguish between different states (normal/error conditions). Acceptance Criteria:
Verification: Display primary colors and verify visual accuracy, test white balance and off state, measure color transition timing. |
Description: The system SHALL provide a thread-safe API to read the current state of all LED colors for monitoring and visualization purposes (e.g., web interface LED display). Rationale: External components (web server, monitoring tasks) need to read LED state for real-time visualization without interfering with LED control operations. Thread-safe access is critical in multi-task RTOS environment. Acceptance Criteria:
Verification: Call from multiple tasks concurrently, verify no race conditions, confirm returned colors match physical LED state, test with various buffer sizes. |