I am attempting to make an interactive led circuit that automatically calibrates to the light in a room on startup. I have code which I will post after this question…
I am using a infrared receiver to receive the the “threshold” amount of light in the room, I want to find this value just once, in the setup, then, I want to USE this value to compare to the constant Infrared values being received in the loop value, but I do not know how to transfer the value received in the setup scope to the loop scope… Here is my code
int threshold = analogRead(A5);
Serial.println(” Threshold =");
int Receiver = analogRead(A5);
if(Receiver < threshold)
So basically, I am not getting that threshold value to appear in the loop scope. What do/can I do???