I have a program on an 18A that activates a servo when anyone comes into my work room The problem is that it activates the servo too many times (8xish)I would like it to only function 2X each time the PIR is triggered no more. the PIR is on pino, leds are on out 0,2, the servo is on out 3. The code I have now is:
Main: if pin0 = 1 then turn_on
pause 1000
high 0
nap 4
low 0
goto main
turn_on:
high 2
servo 3,80
pause 250
servo 3,180
pause 200
goto turn_off
turn_off:
low 2
pause 50
goto main
Thanks for any help.
Main: if pin0 = 1 then turn_on
pause 1000
high 0
nap 4
low 0
goto main
turn_on:
high 2
servo 3,80
pause 250
servo 3,180
pause 200
goto turn_off
turn_off:
low 2
pause 50
goto main
Thanks for any help.