Shop OBEX P1 Docs P2 Docs Learn Events
PING))) and BS2px24 — Parallax Forums

PING))) and BS2px24

edited 2006-03-03 21:54 in Robotics
Hi All,

OK, more timing issues when using the BS2px24 and the PING))) sensors. If I'm correct (thanks Jon), I've got the servo PULSOUT values for the BS2px24. They are 1875 (servo centre), 1625 (650 on BS2) and 2125 (850 on BS2). Now I'm trying to determine with the correct timing for the PING))) sensor. Looking at the Roaming with PING))) program I see 'PULSOUT Ping, 5 and PULSIN Ping, 1, distance'. I am assuming that these values need to be modified to run correctly on the BS2px24. Which formula do I use to determine these values? I am having a real tough time trying to wean myself onto the BS2px24, due primarily to the timing issues. Can anyone help this math crippled individual? Thanks for your time.

Arf,
Michael

Comments

  • Tom WalkerTom Walker Posts: 509
    edited 2006-03-03 20:40
    As Jon pointed out, conditional compilation is your friend. Adding a few lines to the beginning of your code will eliminate the need to calculate any of the "code-related" timing values. This will even allow you to use the same source file no matter what type of Stamp you are using (assuming you are not using any of the "type-specific" commands such as LCDOUT and OWIN, etc.).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Truly Understand the Fundamentals and the Path will be so much easier...
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-03-03 20:57
    I love Conditional Compilation -- now if I could get others to love it before a timing issue bites them on the backside... smilewinkgrin.gif

    I've attached Ping demo that works the same on any BS2 module; you can use it as the basis for your program, Michael.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • GumbyGumby Posts: 24
    edited 2006-03-03 21:22
    Hey Michael,

    I had to go through the same thing when I upgraded from BS2 to the BS2PX. I am including 2 codes that might help. Please note that in one of the code I am using a different Servo controller that the Parallax but the end result should be the same. If you cannot understand send me a note.
    Hope it helps, and maybe I should read again the 'conditional compilation' info.
    Gilles
  • edited 2006-03-03 21:54
    Thanks for your help. I am looking at conditional compilation, but at the moment I'm trying to learn how to do things manually. I too agree about the conditional compilation, it makes things much easier wink.gif. Thanks again, you guys are wonderful!!

    Arf,
    Michael
Sign In or Register to comment.