/*picmicrolab.com - Photoresistor Light Sensor based on Arduino UNO *************************************************************************************************************** */ int LED_Out = 10; // the setup function runs once when you press reset or power the board void setup() { // initialize I/O as output. pinMode(LED_Out, OUTPUT); //Bit_10 } void loop() { int ReadPhotoResistor = analogRead(A5); if(ReadPhotoResistor < analogRead(A4)) digitalWrite(LED_Out, HIGH); if(ReadPhotoResistor > (analogRead(A4)+50)) digitalWrite(LED_Out, LOW); }