Automatic Light System With Arduino

Automatic Light System With Arduino

 Source Code :


const int ledPin = 13;
const int ldrPin = A0;

void setup () {

  pinMode(ledPin, OUTPUT);
  pinMode(ldrPin, INPUT);
}

void loop() {

  int ldrStatus = analogRead(ldrPin);  
  if (ldrStatus >= 400) {

  
       digitalWrite(ledPin, HIGH);
      delay(1000);
  }
  else {
    
    digitalWrite(ledPin, LOW);

  }
}



Site Link: Download Arduino IDE

💡💡💡💡💡💡💡 Contact Us 💡💡💡💡💡💡 
✅Mail 👉chayanroy70@yahoo.com 

0 Comments