Trying to make a basic PIR Motion Sensor activate a Servo 45 degrees then -45 degrees repeatedly when input is received. I am a complete beginner. I know that the sensor is digital and the output (servo) is analog.
The basic idea is: If analog sensor = On, then for position of servo +45, move it to -45; for position of servo -45, move it to 45. If analog sensor = Off, then stop the servo.
I need help with the code, I have no experience programming.
Thanks to anyone for help!