Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added brightness control to hub75 and i75 #962

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ahnlak
Copy link
Contributor

@ahnlak ahnlak commented Jun 18, 2024

Added get_brightness and set_brightness to Hub75 and (by extension) Interstate75(W) as well.

Rather than trying to do clever things with LUTS, this is applied per-pixel on update; measurements suggest a cost of ~3-4ms per frame on a 32x32 hub, which feels... tolerable?

Things to note:

  • brightness is set as an integer percentage, 0 - 100. I agonised over whether it should be a float, 0 - 1.0f and just converted internally, but I couldn't decide one way or the other!
  • if the brightness is set to 100 (or not set at all), the maths is skipped, so essentially zero cost unless you're using brightness control
  • the brightness is applied by converting the RGB pixel value to HSV, manipulating V and then converting back. This is all done in integer maths (because floating point would destroy everything) and with low resolution boards like this, feels manageable
  • dropped a demonstration into micropython/examples/interstate75 and updated what documentation I could see

ref: #805 among other things...

Copy link

@whatleymd whatleymd left a comment

Choose a reason for hiding this comment

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

I know my approval doesn't mean anything, but just wanted to say thanks for including a get _brightness() function so I can set the UI settings page correctly

@alphanumeric007
Copy link

Nice. =). As you both probably know. I have an LTR-599 wired up to my i75W. It lets me use auto brightness. I'm only displaying text and only using a limited number of colors. My big hurdle was never having used HSV before.
This will save the next person from some head scratching for sure. Especially if your displaying graphic images. =-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants