Shop OBEX P1 Docs P2 Docs Learn Events
How di I better navagate with IR Eyes.. — Parallax Forums

How di I better navagate with IR Eyes..

don_sdon_s Posts: 35
edited 2006-01-11 17:46 in BASIC Stamp
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

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-01-11 14:49
    The STAMP doesn't multi-task --·if you're going to "Check Eyes" then you can't do anything else, exactly.
  • don_sdon_s Posts: 35
    edited 2006-01-11 15:04
    Thanks for the fast reply. I understand about the multi-tasking, so I guess I am trying to find help on correcting this problem. Is there a way to put the servos in a "COAST" mode until I can get the info back from the IR's? Or every time I want to check my distance, I have to stop the bot? I dont seem to remember having this issue when I was using the IR's that came with the kit.

    Don "Ho"
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-01-11 15:11
    How about re-titling your Subject to something like, "How Do I Better Integrate Robot Eyes?".

    Anyway, how did the other sensors get checked?· Maybe you need to check fewer times and/or use/execute fewer instructions (Tighten Up!)
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-01-11 15:35
    Another thing to look at is your lack of a PAUSE 20 after the PULSOUT commands, which may be over-driving the servos, causing them to be jittery.· The PAUSE should only be decreased or removed if you have 20 mS or more of routines happening in your loop.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • don_sdon_s Posts: 35
    edited 2006-01-11 17:46
    Sorry, yes I do have the Pause after the Pulsout. Thanks for all the suggestions..

    Don "Ho"
Sign In or Register to comment.