Shop OBEX P1 Docs P2 Docs Learn Events
BS2p and the HB-25 — Parallax Forums

BS2p and the HB-25

JerryBJerryB Posts: 10
edited 2007-07-26 17:59 in BASIC Stamp
Hi All,
I've been playing with the HB25. Using the BS2 it works just great. I have it hooked up to my BS2p right now and its not behaving as it should. I guess I have to adjust the timing of the pulsout instruction but haven't hit on the right combo yet.·Would someone look at this snippit of code·and tell me what values I should change for the BS2p to get the same results I get with the BS2? Thanks a lot....in the meantime I'll keep trying.

Jerry

· DO : DEBUG ".":LOOP UNTIL HB25 = 1··············· ' Wait For HB-25 Power Up
· LOW HB25······························· ' Make I/O Pin Output/Low
· PAUSE 5································ ' Wait For HB-25 To Initialize
· PULSOUT HB25, 750······················ ' Stop Motor 1
· PAUSE 20

· PAUSE 20····························· ' Wait 20 mS Before Ramping
· FOR index = 0 TO 250················· ' Ramp Up To Full Speed
··· PULSOUT HB25, 750 + index·········· ' Motor 1 Forward
··· PAUSE 20··························· ' 20 mS Smoothing Delay
·· NEXT
· ·STOP

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2007-07-26 17:39
    Syntax: PULSOUT Pin, Duration

    Function
    Generate a pulse on Pin with a width of Duration.
    • Pin is a variable/constant/expression* (0 - 15) that specifies the I/O pin to use. This pin will be set to output mode.
    • Duration is a variable/constant/expression* (0 - 65535) that specifies the duration of the pulse. The unit of time for Duration is described below.

    attachment.php?attachmentid=74083

    Quick Facts
    attachment.php?attachmentid=74084
    721 x 36 - 1K
    549 x 133 - 3K
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-07-26 17:44
    1875 is the center value for the BS2p, not 750. Your range would no longer be 250 but rather 625. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • JerryBJerryB Posts: 10
    edited 2007-07-26 17:49
    Thanks Chris and PJ Allen
    I just used PJ Allen's ref to calculate the center value of 1875. Fixing to try it right now.

    Jerry
  • JerryBJerryB Posts: 10
    edited 2007-07-26 17:59
    And it works. Wonderful to have experts looking over my shoulder!

    Jerry.......
Sign In or Register to comment.