//Program Kendali motor servo dengan sensor PIR
//By Maulana Sabian
#include <Servo.h>
Servo motor_servo;
int pir = 7;
void setup() {
pinMode(pir,INPUT);
Serial.begin(9600);
Serial.println("welcome in my heart");
motor_servo.attach(5);
motor_servo.write(0);
}
void loop() {
int data_pir = digitalRead(pir);
Serial.println(data_pir);
if(data_pir == 0){
motor_servo.write(0);
}
if(data_pir == 1){
motor_servo.write(90);
}
}