I'm thinking the way to do it is use COUNT and just look for X amount of pulses from the 38khz ired xmtr. If > X then high a pin.
Should work I hope. ?
I'm thinking the way to do it is use COUNT and just look for X amount of pulses from the 38khz ired xmtr. If > X then high a pin.
Should work I hope. ?
Bummer. Never used COUNT before, maybe I'm missing something?
CT VAR WORD
COUNT portb.5, 1000, CT
IF CT > 10 then
HIGH porta.7
CT = 0
ENDIF
Getting nothing. Using 16f628a and 4mhz.
I have no doubt there are more than 10 pulses in a second with the ired data out.
Presto -- thought I had the count set at 10 (was 20) -- working great now.
Like the way I have conversations with myself on the forum?
Kind of a cool way to use these ired units for a simple foolproof switch actually.
Hi ...
I am using same code ish
Works fine for me also..... But I I am getting false triggers due to mains spikes (My circuit is on a 12v Battery then LDO down to 5v....Was wondering what your circuit looked like ... If I was missing anything maybe ...count ir,500,realtrig ' Looks for real trigger
if realtrig >15 then 'if real ir then turn light on
gosub Seconds 'then on 88 Seconds
endif
return
Andy
Bookmarks