I've got a IR Rx strapped to a servo that I want to use to find an IR homing signal:
The problem is after the three second wait is over following the debug b3=5 line, the servo will increment what looks like 75 pulses while running the "irin" command. After the 0.55 second pause it returns back to the position it should be in.
Two days of banging my head has given me quite the knot on my skull. Is there some timer conflict I'm not aware of? I've had my girlfriend confirm my hardware is setup correctly (and consequently taught her the pinout on a 28X2). I'm at a loss.
Thanks in advance for any help.
Code:
symbol pos = b1
symbol ir_code = b2
init:
servo 7,150
pause 250
ir_wide_scan2:
let b3=1:debug:wait 3
for pos = 225 to 75 step -5 'increments servopos value
let b3=2:debug:wait 3
servopos 7, pos 'starts servo full left, tried using "servo" command too
let b3=3:debug:wait 3
let ir_code = 0 'reset any previous IR codes
let b3=4:debug:wait 3
gosub ir_sense
let b3=7:debug:wait 3
next pos
goto ir_wide_scan2
return
lock_on:
let b3=100:debug:wait 3
low c.0 'powers an indicator LED
pause 2000
high C.0
goto ir_wide_scan2
return
ir_sense:
let b3=5:debug:wait 3
irin [550,ir_timeout],A.0,ir_code 'look for IR signal
let b3=99:debug:wait 3
if ir_code = 5 then goto lock_on
return
ir_timeout:
let b3=6:debug:wait 3
return
Two days of banging my head has given me quite the knot on my skull. Is there some timer conflict I'm not aware of? I've had my girlfriend confirm my hardware is setup correctly (and consequently taught her the pinout on a 28X2). I'm at a loss.
Thanks in advance for any help.
Last edited: