--- title: StatusLight Component description: Documentation for the StatusLight component used in ESP-32 industrial applications with Modbus-485 support. keywords: ESP-32, Platform.io, Modbus-485, StatusLight, C17, industrial --- ## STATUSLIGHT **Path**: [../src/components/StatusLight.h](../src/components/StatusLight.h) **Revision History**: Initial documentation The `StatusLight` component provides control over status LEDs with support for steady (ON/OFF) and blinking states. It integrates with Modbus for remote monitoring and control. ## REQUIREMENTS - **Pins**: - A GPIO pin configured for output (e.g., `PIN_LED_FEEDBACK_0`). - **Dependencies**: - Arduino framework. - Modbus-485 support (`ModbusTCP.h`). - Logging (`ArduinoLog.h`). - Component base class (`Component.h`). ## FEATURES - Supports ON, OFF, and BLINK states. - Modbus integration for remote state monitoring and control. - Configurable blink intervals. - Detailed logging for debugging. ## TODOS - Add support for custom blink patterns. - Implement energy-saving modes. - Extend Modbus functionality for advanced configurations. ## EXAMPLE ```cpp #ifdef PIN_LED_FEEDBACK_0 StatusLight statusLight_0 = new StatusLight( this, // owner PIN_LED_FEEDBACK_0, // pin ID_LED_FEEDBACK_0, // key LED_FEEDBACK_0_MB_ADDR // modbusAddress ); if (statusLight_0) { components.push_back(statusLight_0); Log.infoln(F("StatusLight_0 initialized. Pin:%d, ID:%d, MB:%d"), PIN_LED_FEEDBACK_0, ID_LED_FEEDBACK_0, LED_FEEDBACK_0_MB_ADDR); } else { Log.errorln(F("StatusLight_0 initialization failed.")); } #endif ```