// Define LDR pin connected to analog pin A0
const int ldrPin = A0; // LDR output connected to A0
int ldrValue = 0; // Variable to store the light intensity reading
void setup() {
Serial.begin(9600); // Start serial communication at 9600 baud
pinMode(ldrPin, INPUT);
}
void loop() {
ldrValue = analogRead(ldrPin); // Read the analog value from LDR
Serial.print("LDR Value: ");
Serial.println(ldrValue); // Print the value to Serial Monitor
delay(1000); // Delay of 1 second between readings
}