Shop OBEX P1 Docs P2 Docs Learn Events
Servo Object? — Parallax Forums

Servo Object?

kerrywkerryw Posts: 61
edited 2006-05-31 00:32 in Propeller 1
Is there a simple Servo controller object available? I looked at the library one and it looks like it needs external chips to support that many. I'm just looking for an object that can control 4 servos simultaneously. Any suggestions? Thanks.

Kerry

Comments

  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2006-05-29 20:56
    kerryw,

    Check out the object in the Propeller Object Library (Servo_Demo.zip).

    http://www.parallax.com/propeller/object.asp

    This object will allow you to control up to 32 servo's without any additional hardware.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • kerrywkerryw Posts: 61
    edited 2006-05-29 22:30
    Thanks Beau. I'm paring that code down now for a smaller requirement. I'd actually like something where I could set which specific pins to use for servos, and allow for smaller number (like 4).

    BTW, shouldn't this

    long ServoDataA[noparse][[/noparse]47] ' 0-47 Servo Pulse Width information
    long ServoDataB[noparse][[/noparse]47] '48-95 Servo Pulse Width information

    be this?

    long ServoDataA[noparse][[/noparse]48] ' 0-47 Servo Pulse Width information
    long ServoDataB[noparse][[/noparse]48] '48-95 Servo Pulse Width information


    Thanks again Beau
    Kerry
  • CJCJ Posts: 470
    edited 2006-05-29 22:33
    I made one the other day, works fairly well, I will post it when I get a chance

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Who says you have to have knowledge to use it?

    I've killed a fly with my bare mind.
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2006-05-29 22:41
    kerryw,

    That's the wrong code!!· In the object directory it should only be a 32 servo driver.

    What's in there right now is a 96 servo driver.· Let me try to figure out what happened
    and post the correct code for the 32 servo driver.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • kerrywkerryw Posts: 61
    edited 2006-05-29 22:49
    Thanks Beau. I'm just looking for something less hardcoded and more generic. Having to use a block of 8 pins makes the demo board less useful as it only has 8 available for general use.

    Thanks,
    Kerry
  • CJCJ Posts: 470
    edited 2006-05-29 23:21
    here is my *very* basic servo control object, be careful what pulse widths you send to it, it doesn't have limiters

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Who says you have to have knowledge to use it?

    I've killed a fly with my bare mind.
  • kerrywkerryw Posts: 61
    edited 2006-05-30 00:26
    Thanks CJ, that looks like it will do exactly what I wanted.

    Kerry
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2006-05-30 21:21
    kerryw,

    Here is an updated 32 servo object. Feel free to use CJ's or this one.
    I will try to get this correctly updated in the Propeller Object Library.

    The whole point of exchanging or using object's and making them open
    source is so that anyone can tweak, modify, or simply just use them
    as they see fit to do so.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • kerrywkerryw Posts: 61
    edited 2006-05-31 00:32
    Thanks Beau!

    Kerry
Sign In or Register to comment.