How di I better navagate with IR Eyes..
don_s
Posts: 35
Little history, trying to get a couple of Sharp IR to work. Finally did that with help from here. Now I cant seem to get the bot to move while I am checking the IR's. Pusedo Code is as follows:
Do
Gosub CheckEyes ' This checks the Ir's both Left Front and Right Front.
If (left Distance < Min Distance) and (Right Distance < Min Distance)
Rightpulse = XXX 'All Stop
leftpuse = XXX
ElseIf left Distance < xxx
RightPulse = XXXX ' Turn Right
ElseIf Right Distance < XXX
LeftPUlse = XXX 'Turn Left
Else
RightPulse = XXXX
LeftPulse = XXXX 'Go Forward
EndIf
Pulsout 14, rightpulse
Pulsout 15, leftpulse
Loop
Now, if I take out the CheckEyes it works fine, but once I put the Checkeyes Routine in then the bot pulses..
THanks
Don "Ho"
Post Edited (don_s) : 1/11/2006 5:44:41 PM GMT
Do
Gosub CheckEyes ' This checks the Ir's both Left Front and Right Front.
If (left Distance < Min Distance) and (Right Distance < Min Distance)
Rightpulse = XXX 'All Stop
leftpuse = XXX
ElseIf left Distance < xxx
RightPulse = XXXX ' Turn Right
ElseIf Right Distance < XXX
LeftPUlse = XXX 'Turn Left
Else
RightPulse = XXXX
LeftPulse = XXXX 'Go Forward
EndIf
Pulsout 14, rightpulse
Pulsout 15, leftpulse
Loop
Now, if I take out the CheckEyes it works fine, but once I put the Checkeyes Routine in then the bot pulses..
THanks
Don "Ho"
Post Edited (don_s) : 1/11/2006 5:44:41 PM GMT
Comments
Don "Ho"
Anyway, how did the other sensors get checked?· Maybe you need to check fewer times and/or use/execute fewer instructions (Tighten Up!)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Don "Ho"