-
Notifications
You must be signed in to change notification settings - Fork 495
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
Use the LUX sensor to automatically set brightness #628
Conversation
(This is tested on my Tufty2040, since I don't see an automatic build test for that.) |
Hmm. The pylint check is simply saying |
Looks like it doesn't like your line break in
|
Weird, I don't get that finding locally. Looks like this check is also failing on other contempoary PRs in the same way, so I assume it's an infra problem and leave the commits as-is for now. |
We're linting with Run with:
|
Combine the board features in the suggested fashion in the most featureful badge example. Read the photosensor and set the display brightness accordingly.
3913a4c
to
3d556db
Compare
There we go; ahnlak was indeed correct:
Line rewrapped in a way it's happy with. |
@helgibbons dare I ask if you managed to test this 👀 |
This (and #629 ) works - thanks @LionsPhil , and super-thanks for fixing the Tufty launcher! However, I'm finding it quite flickery at certain brightness levels. I think the LED lights in this office may be the culprit, as I've just wandered round the building and under different kinds of lights it's absolutely fine. Could be possible to add more averaging/sampling to improve this behaviour, perhaps? It might be a good idea to have the brightness/battery adjusting version as a separate example due to the added complexity, but if we are adding it to the default example it might be best to have this functionality turned off by default. I really like the dimming being connected to both light level and battery level though :) |
Here's a video which hopefully shows the flickering a little: |
Ah yeah, that's annoying. Alright, my actual personal badge example has a combination of these which iterates on them a bunch, including some smoothing; I'll see if I can pull that out as a standalone example. I assume it's cleanest to make that a separate PR and retract these two? |
Sounds good, thanks! |
Standalone smoothed display auto-brightness, reactive to the on-board LUX and battery ADC sensors, with debugging keys so it's easier to test (and play with). Closes pull requests pimoroni#628 and pimoroni#629, which did this to the retro_badge example, but made it too complicated.
Replaced with #701 |
Combine the board features in the suggested fashion in the most featureful badge example. Read the photosensor and set the display brightness accordingly.