Skip to content

Conversation

@thatcomputerguy0101
Copy link
Contributor

@thatcomputerguy0101 thatcomputerguy0101 commented Jan 27, 2026

Description

This fixes a few problems with controlling dimmable LEDs.

  • The dimmable led code did not recognize the off state, so it was always on. A new condition was added to fix this.
  • The C++ photonlib library was using the wrong topic names for ledMode (bug in Robustify setting pipeline index #790), preventing the state from being synchronized.
  • The LL2+ hardwareConfig.json had its PWM frequency set too high for an RPi to achieve, causing timing imprecision resulting in LED flicker.
  • The LL2+ and LL3 images did not have hardware PWM enabled; the software PWM fallback caused timing imprecision resulting in LED flicker.
  • Brightness change updates from the slider would get suppressed while the current LED mode was not kDefault. The output state is now tracked separately so that brightness updates can be correctly applied.

Tested on a LL2+ and LL3, LED control works as expected (NT updates work, brightness changes work, brightness is not flickery) once combined with photon-image-modifier#124.

Closes #2335

Meta

Merge checklist:

  • Pull Request title is short, imperative summary of proposed changes
  • The description documents the what and why, including events that led to this PR
  • If this PR changes behavior or adds a feature, user documentation is updated
  • If this PR touches photon-serde, all messages have been regenerated and hashes have not changed unexpectedly
  • If this PR touches configuration, this is backwards compatible with all settings going back to the previous seasons's last release (seasons end after champs ends)
  • If this PR touches pipeline settings or anything related to data exchange, the frontend typing is updated
  • If this PR addresses a bug, a regression test for it is added

@github-actions github-actions bot added backend Things relating to photon-core and photon-server photonlib Things related to the PhotonVision library documentation Anything relating to https://docs.photonvision.org labels Jan 27, 2026
@thatcomputerguy0101
Copy link
Contributor Author

This works as expected on a LL2+ now, with additional image changes to enable hardware PWM (otherwise the brightness is flickery since PV doesn't leave room for consistent software PWM).

Copy link

@frcwildfire8151 frcwildfire8151 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can confirm this works, but Limelight 2+ still flickers when brightness isn't set to 0% or 100%.

Copy link

@frcwildfire8151 frcwildfire8151 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried flashing Limelight 2 image and uploading this Limelight 2+ hardware config, it still flickers when brightness isn't set to 0% or 100%.

@thatcomputerguy0101
Copy link
Contributor Author

See my previous message for an explanation of why.

@thatcomputerguy0101
Copy link
Contributor Author

Once combined with photon-image-modifier#124, this fixes all of the problems I identified with illumination LED control on a LL2+

@thatcomputerguy0101 thatcomputerguy0101 marked this pull request as ready for review January 28, 2026 19:31
@thatcomputerguy0101 thatcomputerguy0101 requested a review from a team as a code owner January 28, 2026 19:31
@mcm001
Copy link
Contributor

mcm001 commented Feb 2, 2026

Let's cut an image tag, and incorporate that in this PR?

@mcm001
Copy link
Contributor

mcm001 commented Feb 2, 2026

@mcm001 mcm001 changed the title Fix dimmable leds Fix dimmable LED off-state, topic names, PWM flicker, and brightness update outside kDefault Feb 2, 2026
Copy link
Contributor

@mcm001 mcm001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy with this code, but I'd like us to see how we can get any sort of test coverage of VisionLED.java in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Things relating to photon-core and photon-server documentation Anything relating to https://docs.photonvision.org photonlib Things related to the PhotonVision library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Limelight 2+ Unable to Control The LED

5 participants