omi icon indicating copy to clipboard operation
omi copied to clipboard

feature: Dim or turn off led light

Open AshAnand34 opened this issue 8 months ago • 3 comments

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.c to enable brightness control.
  • Updated the led_start function to check the readiness of the PWM devices and log that PWM support is enabled.
  • Introduced new functions in omi/firmware/devkit/src/led.c to set LED brightness using PWM, including set_led_brightness, set_led_red_brightness, set_led_green_brightness, and set_led_blue_brightness.
  • Added a high-level API function set_led_brightness_api to 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.js to 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 avatar May 16 '25 02:05 AshAnand34

@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.

vercel[bot] avatar May 16 '25 02:05 vercel[bot]

cool ! @AshAnand34

1/ could you share a demo video ?

beastoin avatar May 16 '25 05:05 beastoin

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?

AshAnand34 avatar May 17 '25 06:05 AshAnand34

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

beastoin avatar May 26 '25 06:05 beastoin