Comments (7)
Ok apologies, I think I was looking at that ISR conditional wrongly.
I think this is the proper place to look for dimming:
https://github.com/zerog2k/stc_diyclock/blob/master/src/main.c#L491-L500
note that we are decimating the raw adc value from 8 to 5 bits
so from 256-0 (darkest to brightest) mapped to 32-0
I think this lightval
acts sort of like a variable denominator in the fraction of duty cycle of led lighting. Larger denominator, shorter duty cycle; smaller denominator, longer duty cycle.
So perhaps try changing
lightval = getADCResult8(ADC_LIGHT) >> 3;
to
lightval = getADCResult8(ADC_LIGHT) >> 2;
such that it's bottom range is 64 (darkest) instead of 32
from stc_diyclock.
You can try it and let me know how well it works.
from stc_diyclock.
The dimming is controlled somewhat creatively to get around some limitations (like running in ISR)- controlled here:
https://github.com/zerog2k/stc_diyclock/blob/master/src/main.c#L234
if (displaycounter % lightval < 4 ) {
you can try playing around with different values (instead of 4), like 3?
from memory, lightval
is raw ldr circuit adc values, and (I think?) it should be from 0-1023, and decrease (toward zero) when bright, and increase (toward 1023) when dark ?
this number here is trying to divide the raw adc lightval such that it skips lighting when displaycounter % (lightval < 4) == 0
if that's helpful
I don't have a way to test currently, but you can play around with this, and build/upload using platformio pretty easily
from stc_diyclock.
thanks, but it doesn't work:
setting if (displaycounter % lightval < 3 ) {
would lead to weird display refresh misbehavior, especially with the 4th digit
any other ideas on how to make the brightness level in the dark as low as possible?
from stc_diyclock.
thanks a lot, this seems to be doing the trick. would setting the value to 1 make it even darker then?
from stc_diyclock.
Sounds like a plan- did just that and pretty happy with the results - the display is now a tad dim for some, but should not be a distraction at night anymore, so I guess mission accomplished - thank you so much for your help and for this awesome firmware 🙏🏻👍🏻
from stc_diyclock.
I solved the brightness problem by 3d printing a thin 0.6mm thick screen to fit in the bottom of the acrylic case to cover the leds.
from stc_diyclock.
Related Issues (20)
- "Waiting for MCU, please cycle power" HOT 3
- Maybe new model? Schematic Provided.. HOT 9
- 4 digit display models? HOT 3
- buttons don't work HOT 17
- Website for original maker of these kits
- Need help with make on windows HOT 1
- синхронизация времени с приемником GPS вывод последовательных данных NMEA HOT 8
- Time stops ticking when power is lost HOT 1
- Привет! HOT 3
- Dot-Matrix version? HOT 3
- hourly chime HOT 3
- Weird bevaviour with STC15W408AS HOT 7
- New hardware version from Banggood w/ STC15W408AS? HOT 25
- My kit reset time to 00:00 01-01-2000 each power cycle HOT 2
- barebone firmware HOT 3
- Firmware for clock with voice HOT 3
- Worked for 10 minutes with new chips and then stopped... HOT 3
- Random slow downs. STC15W408AS HOT 2
- Makefile SDCCOPTS HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stc_diyclock.