// Define the analog pin connected to the LDR
const int ldrPin = A0;
void setup() {
Serial.begin(9600); // Start serial communication
}
void loop() {
int ldrValue = analogRead(ldrPin); // Read analog value (0–1023)
Serial.print("Light Intensity: ");
Serial.println(ldrValue); // Print the value to Serial Monitor
delay(500); // Wait half a second before next reading
}