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

Backlight timeout brightness is hardcoded and too high #111

Closed
gkoh opened this issue Aug 11, 2024 · 5 comments · Fixed by #113
Closed

Backlight timeout brightness is hardcoded and too high #111

gkoh opened this issue Aug 11, 2024 · 5 comments · Fixed by #113
Assignees
Labels
bug Something isn't working good first issue Good for newcomers
Milestone

Comments

@gkoh
Copy link
Owner

gkoh commented Aug 11, 2024

Thanks to #108 I reviewed the backlight timeout brightness handling ... and it sucks with multiple problems.

Let's start with the first problem:

If we look at the ezBacklight::menu(), the brightness slider goes down to 48, something I recall determining via trial and error on the original M5StickC.

This means if we set minimum brightness at 48, we actually increase brightness to 64 during inactivity timeout, this is so wrong.

Second problem:

  • the minimum brightness is different for different devices
    • 64 is quite bright for the M5StickC Plus2 and M5Stack Core

I propose the following solutions:

  1. Add a private method to ezBacklight, say ezBacklight::getMinimumBrightness()
    • this should return the minimum viable brightness per device, I experimentally determined the following (subject to input):
      • M5StickC, M5StickC Plus == 48
      • M5StickC Plus2, M5Stack Core[2] == 16
  2. Use ezBacklight::getMinimumBrightness() in:
    • ezBacklight::loop() during inactivity
    • ezBacklight::menu() as the minimum brightness in the slider
@gkoh gkoh added this to the v2.1.0 milestone Aug 11, 2024
@gkoh gkoh added bug Something isn't working good first issue Good for newcomers labels Aug 11, 2024
@gkoh
Copy link
Owner Author

gkoh commented Aug 11, 2024

@hijae Would you be interested in working on this?

@hijae
Copy link
Contributor

hijae commented Aug 11, 2024

Yes. i want to do.
And #112 too.

@hijae
Copy link
Contributor

hijae commented Aug 11, 2024

I noticed while working that even with the backlight set to 0, I can see that the screen is very dimly lit.
I guess it would be possible to set the backlight to 0 and turn on the power LED.

@gkoh
Copy link
Owner Author

gkoh commented Aug 12, 2024

I noticed while working that even with the backlight set to 0, I can see that the screen is very dimly lit. I guess it would be possible to set the backlight to 0 and turn on the power LED.

Possibly, let's implement and then we can adjust as needed.

@gkoh
Copy link
Owner Author

gkoh commented Aug 12, 2024

Yes. i want to do. And #112 too.

OK, I will assign both to you, thank you.

@gkoh gkoh linked a pull request Aug 12, 2024 that will close this issue
gkoh pushed a commit that referenced this issue Aug 14, 2024
* Fix and enhancement
#111 Backlight timeout brightness is hardcoded and too high
#112 Backlight menu slider needs tweaking

* get close enough to 100%, adjust 9step to 8step

* use a step counter in the loop

* Modified to match clang-format
@gkoh gkoh closed this as completed in #113 Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants