#include <Wire.h>
#define LDR_PIN 34 // Connect LDR to this pin
#define LED1_PIN 26 // Connect first LED to this pin
#define LED2_PIN 27 // Connect second LED to this pin
#define LED3_PIN 25 // Connect third LED to this pin
void setup() {
Serial.begin(115200);
pinMode(LDR_PIN, INPUT);
pinMode(LED1_PIN, OUTPUT);
pinMode(LED2_PIN, OUTPUT);
pinMode(LED3_PIN, OUTPUT);
}
void loop() {
int ldrStatus = analogRead(LDR_PIN);
if (ldrStatus <= 2000) {
digitalWrite(LED1_PIN, HIGH); // Turn on first LED if it's dark
digitalWrite(LED2_PIN, HIGH); // Turn on second LED if it's dark
digitalWrite(LED3_PIN, HIGH); // Turn on third LED if it's dark
Serial.println("LEDs: ON");
} else {
digitalWrite(LED1_PIN, LOW); // Turn off first LED if it's light
digitalWrite(LED2_PIN, LOW); // Turn off second LED if it's light
digitalWrite(LED3_PIN, LOW); // Turn off third LED if it's light
Serial.println("LEDs: OFF");
}
delay(1000);
}