LedModule API Reference
TheLedModule class provides comprehensive LED control functionality for MentraOS Apps, including RGB LED control and pattern methods. It automatically handles request tracking and provides fire-and-forget LED control with immediate resolution.
Import
Class: LedModule
The LedModule is automatically instantiated by the AppSession. You should not create instances directly.Low-level LED Control Methods
turnOn
Turn on an LED with specified timing parameters.options: LED control configuration
turnOff
Turn off all LEDs on the connected glasses.Pattern Methods
blink
Blink an LED with specified timing.color: LED color to useontime: How long LED stays on (ms)offtime: How long LED stays off (ms)count: Number of blink cycles
solid
LED stays on continuously for specified duration.color: LED color to useduration: How long LED stays on (ms)
Capability Methods
getCapabilities
Get available LED capabilities for the current device.Interfaces
LedControlOptions
Options for LED control.LedColor
Available LED colors.Device Compatibility
Different smart glasses models have different LED capabilities:| Device | LED Support | LED Types | Colors Available |
|---|---|---|---|
| Mentra Live | ✅ Yes | RGB + White | All colors |
| Even Realities G1 | ❌ No | None | N/A |
| Vuzix Z100 | ❌ No | None | N/A |
Best Practices
1. Always Check Device Capabilities
2. Use Semantic Colors
3. Handle Errors Gracefully
4. Provide Graceful Fallbacks
5. Don’t Overuse LEDs
6. Combine with Other Feedback Methods
Common Use Cases
Notification System
Recording Indicator
Related Documentation
- Device Capabilities - Check LED hardware support
- App Session - AppSession class reference

