must be more like this
Code:
CMCON=7 ;disable internal voltage comparator
pir VAR GPIO.5 ;define GPIO.5 pin as pir
cam VAR GPIO.4 ;define GPIO.4 pin as cam
loop100times VAR BYTE ;define variable for big delay loop
loop:
loop100times=100
if pir then ;mean if pir=high
cam=1 ; do the same thing as HIGH cam
pause 1000 ; pause 1 sec as request
cam=0 ;same as LOW cam
; now do the big delay
while loop !=0
pause 1800
loop100times=loop100times-1
wend
endif
goto loop
if i well understand what your project do is waiting for a high state on pir pin then send 0 level to cam pin 1 sec after send high level to cam pin during 180 sec (3 minutes) right??? but i think something is missing!!! let me know the exact thing you want to do...
As i read you're a newbie so take care of MCLR (pin 4) is pulled up with resistor(4.7K-10K) to 5 volt supply.
it's suppose to work well now.
regards
Last edited by mister_e; - 14th October 2004 at 05:24.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks