#include <Servo.h>
Servo myservo;
int servomotor = 10;
int led = 11;
int pir = 12;
void setup() {
// put your setup code here, to run once:
pinMode(pir, INPUT);
pinMode(led, OUTPUT);
myservo.attach(9);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
int value_pir = digitalRead(pir);
if (value_pir==HIGH){
digitalWrite(led, HIGH);
myservo.write(180);
Serial.println("hehhehehhehheh motion detected lul");
}
else{
digitalWrite(led, LOW);
myservo.write(0);
Serial.println("hehhehehhehheh motion not detected lol");
}
}