Skip to content
New issue

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

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

Already on GitHub? # to your account

Improve homescreen backlighting to depend on external light #76

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

Conversation

thibault-ml
Copy link

Instead of relying on what power remains in the battery, rely instead on the external lighting to adapt the brightness of the screen.
Note that this might need a bit more fine-tuning.

@thinkl33t
Copy link
Contributor

Ideally the code for reading the light sensor should be put into a function in onboard.py, similar to the battery voltage sensor.

@thibault-ml
Copy link
Author

thibault-ml commented Aug 9, 2016

@thinkl33t Thanks, I was using what was already there, but I've now changed it to use what already exists: onboard.get_light()

ugfx.backlight(70)
l = onboard.get_light()

lum_percent = int(l * 100 / 4095)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be put into a function in onboard.py similar to the battery percentage one? Once it is i think it should be mergeble :)

Instead of relying on what power remains in the battery, rely instead on the external lighting to adapt the brightness of the screen.
Note that this might need a bit more fine-tuning.
@thibault-ml
Copy link
Author

@thinkl33t Thanks, updated!

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

Successfully merging this pull request may close these issues.

2 participants