Shop OBEX P1 Docs P2 Docs Learn Events
program for a Pololu micro serial servo controller? — Parallax Forums

program for a Pololu micro serial servo controller?

TimNTimN Posts: 32
edited 2006-03-05 22:42 in General Discussion
does anyone happen to have a sample BS2pe program for a Pololu micro serial servo controller?·


Post Edited By Moderator (Chris Savage (Parallax)) : 3/5/2006 2:43:37 AM GMT

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-03-05 02:44
    There are examples in the manual at the following link.

    http://www.parallax.com/dl/docs/prod/motors/plolumtorcontr.pdf

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • TimNTimN Posts: 32
    edited 2006-03-05 04:09
    that's for a·standard motor.· i was hoping someone might have something for the pololu servo controller.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-03-05 07:17
    The documentation is pretty clear about the protocol -- should be very easy. You ask for a demo, but not which mode -- and that controller has two.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • TimNTimN Posts: 32
    edited 2006-03-05 15:58
    I want to use the Micro Serial servo controller in the Pololu mode which should allow me to control the speed etc.· I also appears to be the best mode to use when incorporating it into the BS2pe basic stamp.· I agree that writing the program appears to be straight forward, but I always get the yellow and red lights turning on when I try to run the programs.· Any help would be greatly appreciated.
  • randyazrandyaz Posts: 61
    edited 2006-03-05 21:43
    attach the code your·using·too...
  • TimNTimN Posts: 32
    edited 2006-03-05 22:02
    uh... it is something like " serout 11, 188, [noparse][[/noparse]$128, $1, 4, 0, range1, range2]" where range1 and range2·are supposed to be the data bytes where some other variable is split up.· that's one of the problems, is that that i can't figure out how to split up the pulse length into the 2 required bytes
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-03-05 22:14
    Use a Word variable if the range is supposed to be greater than 255, the use the .LOWBYTE and .HIGHBYTE modifiers to send the constituent bytes (PBASIC makes these kind of things easy).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • TimNTimN Posts: 32
    edited 2006-03-05 22:18
    so wait, if i use .lowbyte and .highbyte, then that would split it up?· the one thing is,·bit 7 of each byte that is sent out must be "0" or else it resets the controller.· does the .lowbyte and .highbyte take care of that?
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-03-05 22:37
    Okay, here's how you deal with that: Let's say you have a Word variable called position that you need to divide up into two 7-bit values....

    · dbLo = position & $7F
    · dbHi = (position >> 7) & $7F

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • TimNTimN Posts: 32
    edited 2006-03-05 22:42
    thank you!
Sign In or Register to comment.