feature: Dim or turn off led light
This pull request introduces support for PWM (Pulse Width Modulation) to control LED brightness in the firmware and provides an example integration for a UI to interact with this functionality. The changes include adding PWM configurations, new functions for setting LED brightness, and a JavaScript example for API-based control.
Related issue: #2317
Firmware Enhancements for LED Brightness Control:
- Added PWM device definitions for red, green, and blue LEDs in
omi/firmware/devkit/src/led.cto enable brightness control. - Updated the
led_startfunction to check the readiness of the PWM devices and log that PWM support is enabled. - Introduced new functions in
omi/firmware/devkit/src/led.cto set LED brightness using PWM, includingset_led_brightness,set_led_red_brightness,set_led_green_brightness, andset_led_blue_brightness. - Added a high-level API function
set_led_brightness_apito allow setting brightness for specific LEDs by color name, with error handling for invalid inputs.
UI Integration Example:
- Created a new JavaScript example in
omiGlass/public/led_control_example.jsto demonstrate how to send brightness control commands to the firmware via an API. This includes input validation and error handling for the API calls.
@AshAnand34 is attempting to deploy a commit to the kodjima33's projects Team on Vercel.
A member of the Team first needs to authorize it.
cool ! @AshAnand34
1/ could you share a demo video ?
cool ! @AshAnand34
1/ could you share a demo video ?
Hi @beastoin. I don't have the device with me, unfortunately. Do you know if there is a way for me to demo this feature without the need for it?
man, appreciate your time but testing is a must before sending a review request.
if you dont test, how would you know it works ?
so my suggestion is, either build the device yourself, or buy an omi device.
run the test on it and reopen the PR.
@AshAnand34