Hello everyone. One of my current projects needs some help. It's an LED signal bar for my car. Rear window mount, inside, WS2812's, Nano, 5V, mounted with 3D printed brackets and magnets.
I've added a light sensor(TEMPT6000) to vary the brightness. One level for daytime and a reduced level for nighttime. Here's the code snippet:
sensorValue1 = analogRead(lightInPin1);
outputValue1 = map(sensorValue1, 0, 400, 0, 500); //Using HiLetgo TMT6000 sensor
The sensor is very sensitive and so are the read values. Very fast reaction. My problem is, I don't want the LEDs basically flashing with the quick changes in value. Like passing through the shade from a tree for a moment in the daytime or passing under a streetlamp at nighttime. With my desk lamp, holding my hand over the sensor and varying the light(like clouds?) can hit a point where the bar strobes. Is there a way to slow down the read value, or the reaction time of the updated brightness value? I thought about keeping this snippet in the setup and have it set once when the car is started, and that's of course still an option, I just wanted it a little more active, to react to dark foul weather, tunnels, etc.