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

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.

@thibault-ml thibault-ml force-pushed the improve-homescreen-backlight branch from 0830546 to 2ac78d8 Compare August 9, 2016 11:31
@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 thibault-ml force-pushed the improve-homescreen-backlight branch from 2ac78d8 to 5dfac57 Compare August 9, 2016 13:49
@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()

@thibault-ml thibault-ml force-pushed the improve-homescreen-backlight branch from 5dfac57 to 75c2a1f Compare August 9, 2016 13:52
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 thibault-ml force-pushed the improve-homescreen-backlight branch from 75c2a1f to da6d8e0 Compare August 20, 2016 01:02
@thibault-ml
Copy link
Author

@thinkl33t Thanks, updated!

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.

2 participants