-
Notifications
You must be signed in to change notification settings - Fork 84
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
Support of ambient light sensor #74
Comments
i hacked this at the end of my main, works great
I made the mistake to develop my text pull request in the main branch, so i have no clue how to address a second feature meanwhile. to develop in main and a feature seams to be a broblem, at least GH allows now new bransch with open PR on feature... |
Hello, i want to add the LDR-Featue to my OBEGRÄNSAD, but it wont work. Dont know, wether its a Software or a Hardware-Thing I wired like some Examples in the Web with a LDR at 3V3, a 10k Resistor to GND and GPIO15. To fix the Software-Side would you be so kind and post your Code? Just putting it to the End of main.cpp gives me some Errors while compiling.... Thanx! |
It should be just somewhere within the loop… |
OK. Did that. Compiles, but seems to have still no Effect. Tested with old LDR, changed LDR now: I use a Type 5537 LDR now. Depends something in the Code of the LDR-Type? Thanx for reading! |
Just uncomment
This should show you what the reading was you got from the sensor and to which brightness it translated. I'm not so much a electronic expert, but from what i got, the LDR and the "normal" resistor will just make a voltage divider. The analog input measures the current left. So you should be able to see the changes with a multimeter (sensor vs. ground) or as changing sensor values. My coding above just offeres a "profile" for what reading which brightness shall be set. |
Works for me too, now. Used the wrong Pinning. GPIO15 (as stated the Comments) has also an ADC, but its used |
Not my idea, but mentioned in the german CT make and on the homepage of the author (http://blog.digital-image.de/2023/05/31/x-clock/):
With a cheap LDR it would be possible to measure the actual ambient light - and adjust the LED brightness.
I believe this is reasonably simple (for people who dare to solder on a 100€device), cheap, and far superior to any time base adjustment.
It could be an option to be compiled into the firmware.
Best
Michael
The text was updated successfully, but these errors were encountered: