InfiniTimeOrg / InfiniTime

Firmware for Pinetime smartwatch written in C++ and based on FreeRTOS
GNU General Public License v3.0
2.64k stars 903 forks source link

Smooth brightness transitions with pwm backlight #1870

Open KaffeinatedKat opened 9 months ago

KaffeinatedKat commented 9 months ago

Using the pwm backlight changes from #575, I have changed BrightnessController::Set to smoothly transition from each brightness instead of setting it instantly with the GPIO pins. This small change makes the watch feel much nicer and more polished

Currently, changing the brightness via the setting also does the transition, which I personally think looks fine, but implementing a boolean argument for BrightnessController::Set for the transition to disable this might be a good idea. Would love to hear some thoughts on this

github-actions[bot] commented 9 months ago

Build checks have not completed. Possible reasons for this are:

  1. The checks need to be approved by a maintainer
  2. The branch has conflicts
  3. The firmware build has failed
lukebouch commented 6 months ago

This looks awesome! I’m hoping it gets merged soon.

Saarsk commented 4 weeks ago

This small change makes the watch feel much nicer and more polished

I agree. :) It's one of the first things I noticed with this watch. I just assumed it was a limitation of the LCD panel and there was nothing that could be done to fix it.

Note that I'm imagining the transition from the video linked to in this comment (haven't tried this PR (I don't know how, to be honest)): https://github.com/InfiniTimeOrg/InfiniTime/pull/575#issuecomment-898465400


Currently, changing the brightness via the setting also does the transition, which I personally think looks fine, but implementing a boolean argument for BrightnessController::Set for the transition to disable this might be a good idea. Would love to hear some thoughts on this

Do you mind elaborating on this? Does this mean that you allow for the brightness transition code to be executed without affecting the set brightness levels? And that what I'm seeing on my watch today when adjusting brightness setting would be smoother with this PR?


Also, it would be nice if the brightness would gradually dim after being awakened. Something like this: Backlight on (3 sec) --> slow transition to next lower brightness level --> Another slow transition which continues until display turns off (5 sec)

Whereas the 2nd step (transition to next lower brightness) could extend depending on display timeout user setting. For very short timeout settings like 5s, the transition could start e.g. from second 4 and span over 3 seconds?

Personally I set a 15s timeout setting just because the other ones tend to catch me off guard and I have to re-wake it, which I find annoying. So most of the time the display is being lit way too long, just to solve the annoyance of it going dark before I'm able to react. If I'm reading, I can still read if it transitions into the next lower brightness level and when it starts to fade to black slowly I have the time to keep it wakened if I need to (sometimes I multitask and look at my phone or press a button or whatever and the display just goes dark without any time to react).

If I'm just checking the time or reading a notification, chances are I'll put my wrist down while the LCD is still being backlit at the user set brightness. So a lot of the time it's being brightly lit for nothing and consuming precious energy.

Currently, it wakes to the user set brightness and stays like that for as long as you set the backlight timeout. After which dims briefly and then quickly goes dark before you have a chance to react.

Gradual dimming would not only extend battery life but it would also act as an indicator that the watch isn't picking up "wake intents" and the third phase of slow fadeout will indicate clearly that it's about to turn off (at which point you could choose to extend the backlight active time, if so desired).

I'm positive this would make users set a lower timeout setting, which would have a positive impact on battery time (which is a win-win situation for everyone).


I also think it could be beneficial if the watch was aware of the environment brightness. If I'm in a dark room I would be fine with the lowest brightness (or even lower). If I'm out in the sun and set it to low brightness, suddenly I can't read the display. This can also happen dynamically as I go from the sunny outdoors into a building or even a dark shed.