How to connect a PIR sensor to a raspberry pi and run some code in python. Here's the code in Python:
from gpiozero import MotionSensor
pir = MotionSensor(12) # out plugged into GPIO12
while True:
print("Continue scanning for humans...")
pir.wait_for_motion()
print("Moving human detected! Destroy human!")
pir.wait_for_no_motion()
print("Human deactivated...")