Skip to main content

Sanitizer Machine using Arduino


// Code to connect IR sensor with Arduino

int IRSensor = 2; // connect ir sensor to arduino pin 2
int LED = 13; // conect Led to arduino pin 13

void setup()
{
  pinMode (IRSensor, INPUT); // sensor pin INPUT
  pinMode (LED, OUTPUT); // Led pin OUTPUT
}

void loop()
{
  int statusSensor = digitalRead (IRSensor);
  if (statusSensor == 1)
  {
    digitalWrite(LED, HIGH); // LED LOW
  }
  else
  {
    digitalWrite(LED, LOW); // LED High
  }
}


Follow me @ facebook Instagram linkedin

Comments

Popular posts from this blog

10 Years of Excellence

U Can Project Solution