Shop OBEX P1 Docs P2 Docs Learn Events
Question about PING DEMO program? — Parallax Forums

Question about PING DEMO program?

kingspudkingspud Posts: 128
edited 2005-06-09 21:00 in Robotics
In the PING_DEMO.BS2 program can someone tell me the info for the CASE statement about a BS2PX??

#CASE BS2PX
··· Trigger···· CON···· 5
··· Scale······ CON·····????··················· ' raw x·???? = uS

A lot of the programs do not cover the BS2px chip and since the program leaves out this information the·program does not work!

Thanks

Joe

Comments

  • stamp_demonstamp_demon Posts: 69
    edited 2005-06-08 00:59
    I'm using a bs2px with it, it has the same timming as the bs2sx.. use this..

    #case bs2px
    ·trigger con 13
    ·scale con $0CD·
    ·acually you can just add bs2px to·the the same line .....


    · #case bs2sx, bs2px
    ·ect, ect, ect.

    ·Hope this helps... _Duane
  • kingspudkingspud Posts: 128
    edited 2005-06-08 03:01
    Thanks Duane!
    Works great!
    Joe
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-06-08 12:49
    Indeed, the Ping))) was released before the BS2px so it was not included in the demo (we'll fix that).· You can update your code by adding the BS2px to BS2sx and BS2p section as it has the same PULSIN resolution as those micros.

    #SELECT $STAMP
    · #CASE BS2, BS2E
    ··· Trigger···· CON···· 5······················ ' trigger pulse = 10 uS
    ··· Scale······ CON···· $200··················· ' raw x 2.00 = uS
    · #CASE BS2SX, BS2P, BS2PX
    ··· Trigger···· CON···· 13
    ··· Scale······ CON···· $0CD··················· ' raw x 0.80 = uS
    · #CASE BS2PE
    ··· Trigger···· CON···· 5
    ··· Scale······ CON···· $1E1··················· ' raw x 1.88 = uS
    #ENDSELECT

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • kingspudkingspud Posts: 128
    edited 2005-06-09 20:47
    So I can have the BS2px in the same CASE statement as a BS2sx or BS2p for all the programs?
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-06-09 21:00
    For PULSIN, yes, the resolution is the same as with the SX and P. For SERIN/SEROUT however, the baud calculation is different so it requires it's own parameters.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
Sign In or Register to comment.