PIC BASIC with PIR sensor
Below is my code, I am using a PIC16F84A with PIC BASIC, and am trying to get my PIR to light an LED 2 times, on and off, when it detects an object, any assistance would be much appreciated.
input 5
symbol· PIR············ =5··············· 'Passive infrared sensor, to RB 5
high 1
pause 500
low 1
Main:
IF PIR = 1 THEN PIRdetect
· PAUSE 500
goto main
end
PIRdetect:
·high 1·· 'high RB 1
· pause 500
· LOW 1
·
· pause 500
·
· high 1
· pause 500
· low 1
·
· pause 500
···
goto main
Thank you.
·
input 5
symbol· PIR············ =5··············· 'Passive infrared sensor, to RB 5
high 1
pause 500
low 1
Main:
IF PIR = 1 THEN PIRdetect
· PAUSE 500
goto main
end
PIRdetect:
·high 1·· 'high RB 1
· pause 500
· LOW 1
·
· pause 500
·
· high 1
· pause 500
· low 1
·
· pause 500
···
goto main
Thank you.
·
Comments
Any advice for connection would help me to narrow down the problem.
I really don't think the problem is in the connection. I think it's a programming problem.