There are options
- use a breakout board with a build in comparator, e.g. https://www.berrybase.de/en/lichtsensor ... rce=google
- if you use the capacitor-LDR-approach, then if you increase the capacitor you should use a small series resistor of 220 to 330 Ohm to protect the GPIO. Won't affect accuracy too much.
- if your preference is to use shell script, then why not embed a python script which returns a 'light value' which is then processed in your favorite language
- If you use a Pi5, then use the gpiozero approach of LDR measurement with precaution. This code did not work some time ago and the related ticket is not closed. But works on Pi 1..4, and on Pi5 a plain implementation is fine.
- use a breakout board with a build in comparator, e.g. https://www.berrybase.de/en/lichtsensor ... rce=google
- if you use the capacitor-LDR-approach, then if you increase the capacitor you should use a small series resistor of 220 to 330 Ohm to protect the GPIO. Won't affect accuracy too much.
- if your preference is to use shell script, then why not embed a python script which returns a 'light value' which is then processed in your favorite language
- If you use a Pi5, then use the gpiozero approach of LDR measurement with precaution. This code did not work some time ago and the related ticket is not closed. But works on Pi 1..4, and on Pi5 a plain implementation is fine.
Statistics: Posted by ghp — Mon Dec 02, 2024 4:14 pm