Shop OBEX P1 Docs P2 Docs Learn Events
ServoPal Help needed. — Parallax Forums

ServoPal Help needed.

NWUpgradesNWUpgrades Posts: 292
edited 2012-06-23 13:45 in General Discussion
I would like to use a ServoPal to control a Pan/Tilt mechanism. The documantation and code that are online for the ServoPal only shows how to connect using the BoeBot Servo Ports. I would like to use Pin 0 and Pin 1. What I need help with is what resistor(s) I need to use between the ServoPal and the pins. Also, The code that comes with it is for constant rotation forward and backwards. After reading the instructions I am able to have 1 servo sto while the other rotates. The problem is that I want to use pushbuttons to control each servo and I am confused as to how I would code this since the ServoPal only uses 1 pin as input. I would appreciate any help you experts can advise.

Comments

  • FranklinFranklin Posts: 4,747
    edited 2012-06-22 14:34
    as per the documentation one pin is used to talk to both servos. the first pulse goes to servo0 and if there is a second pulse within a millisecond of the first it goes to servo1. You will probably need to keep track of where each servo is in variables in order to repeat the servo pulse if you are changing only one servo.
  • W9GFOW9GFO Posts: 4,010
    edited 2012-06-22 18:15
    You'll have two variables, one for each servo. Your program will change the variables based upon button input. Make a subroutine that outputs the two pulses using those variables. Whenever the subroutine is called it drives the servos as necessary. If the variable hasn't changed then the servo won't move.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-06-22 19:17
    Franklin wrote:
    You will probably need to keep track of where each servo is in variables in order to repeat the servo pulse if you are changing only one servo.
    That's not necessary. You can individually program each servo over the single pin without affecting the other one. Pages 3 and 4 of the ServoPAL documentation show how it's done.

    -Phil
  • NWUpgradesNWUpgrades Posts: 292
    edited 2012-06-22 19:47
    OK. I think I understand the code portion. What resistors would I need between the ServoPal and the inputs?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-06-22 19:55
    If you're using the ServoPAL with standard logic, you don't need a resistor on its input. BTW, the other pin is an output used for timing apps and is typically a no-connect.

    -Phil
  • NWUpgradesNWUpgrades Posts: 292
    edited 2012-06-22 21:07
    So, Just to clarify. No resistor between the Input of ServoPal,VDD, Gnd and /Inp If I use Pin 0 for Input on Stamp and I would not need to use alarm to Pin 1?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-06-22 21:12
    Correct.

    -Phil
  • NWUpgradesNWUpgrades Posts: 292
    edited 2012-06-23 13:41
    Great. Thanks for the help. How do I mark this thread solved?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-06-23 13:45
    Edit Post your original post, then click Go Advanced, where you can change the title prefix.

    -Phil
Sign In or Register to comment.