Shop OBEX P1 Docs P2 Docs Learn Events
HELP me understand the code — Parallax Forums

HELP me understand the code

RNRN Posts: 28
edited 2010-09-04 02:36 in Propeller 1
I was trying to understand the attached code(Stingray Demo - stingray obstacle avoidance using PING kit) but couldn't come up with an intitutive feel. Anybody who knows this code please help me with few lines....

Comments

  • AleAle Posts: 2,363
    edited 2010-09-04 01:42
    Can you be more explicit ?
    What exactly you do not understand ?

    or is of the kind "I do not from where to start" ?

    In the latter case, I'd recommend you read about <insert_topic_here> to get an idea of how it works or on which concepts it is based, then I'd look at some implementations.
  • RNRN Posts: 28
    edited 2010-09-04 02:36
    I know where to start but what is he trying to do in the code that's unclear
    1. Their are lot of nos in the code eg. maxdelta, rotate, cutoff how did he get those nos.
    2. Exact location of the PING sensors(which one is connected to 0 to1 and to 2).
    3. why?
    Left := Distance[1] * RISK_FACTOR <# Distance[2] * RISK_FACTOR
    Right := Distance[1] * RISK_FACTOR <# Distance[0] * RISK_FACTOR
    4. why?
    OldLeft += (Left - OldLeft) <# MAXDELTA #> (-MAXDELTA)
    OldRight += (Right - OldRight) <# MAXDELTA #> (-MAXDELTA)
    and the list continues....
Sign In or Register to comment.