ARDUINO CODE FOR PIR SENSOR



       

            
int val=0;
#define led 13
void setup()
{
  Serial.begin(9600);
  pinMode(led,OUTPUT);
  }
  void loop()
  {
    val=digitalRead(3);
    if (val==HIGH){
      digitalWrite(led,HIGH);
      Serial.println("motion is detected");
   
      }
      if(val==LOW){
        digitalWrite(led,LOW);
        delay(50);
        Serial.println("nothing is detected");
        }
        }

       
 

Comments

Popular posts from this blog

"Kernel Panic” error After upgrading Parrot OS

HACK HC-05(BLUETOOTH MODULE) FRIMWARE INTO HID FRIMWARE

HACK AND CLONE CAR KEY FOB, MY EPIC FAILURE...!!