PICAXE
PICAXE
Pulsed IR Detector
•
•
•
•
symbol irled    = 2 'pin 5
symbol irsensor   = Pin4  'pin 3
symbol Buzzer    = 1 'pin 6
Top:
pwmout irled, 25, 52 ‘PWM on @ 38.4kHz
if irsensor =0 then goto SawPulse
low  Buzzer
goto Top:
 
SawPulse: 'check for two pulses together
if irsensor=1 then Top: 'must see two pulses
high Buzzer
goto Top: