// Define pins for bulbs and photoresistor const int bulbPin1 = 4; const int bulbPin2 = 7; const int photoResistorPin = A0; // Define light threshold for low light condition const int lightThreshold = 300; // Adjust this value based on your setup void setup() { // Set bulb pins as outputs pinMode(bulbPin1, OUTPUT); pinMode(bulbPin2, OUTPUT); // Initialize serial communication for debugging Serial.begin(9600); } void loop() { // Read the light intensity from the photoresistor int lightLevel = analogRead(photoResistorPin); // Print light level to the Serial Monitor for testing Serial.println(lightLevel); // Check if the light level is below the threshold if (lightLevel < lightThreshold) { // Turn on the bulbs if it's dark digitalWrite(bulbPin1, HIGH); digitalWrite(bulbPin2, HIGH); } else { // Turn off the bulbs if there's enough light digitalWrite(bulbPin1, LOW); digitalWrite(bulbPin2, LOW); } delay(500); // Delay for stability }