Can I program the pin to turn on for the appropriate duration, and off, without further CPU involvement?
Is it ok if the pin keeps on doing the same thing over and over? I don't really know the pulse requirements of a servomotor. Does the pulse have to go just once?
Why is the current Servo class blocking? Does it have to be for some reason I don't know?
I mean when you write to a servo it waits until the motion is complete before execution goes on. It's horribly slow. To make a hand with 5 servos (one per finger), ideally:
You could always move each servo a small distance in turn until it reached the target using the BlinkWithoutDelay technique. A further improvement would be to arrange the size of the increments to make each servo arrive at its target position at the same time if that is what you wanted.
I mean when you write to a servo it waits until the motion is complete before execution goes on
Are you using the standard servo library provided with the IDE?
That library cannot know when the motion is complete (there's no feedback from the servo), so blocking would be futile, and so it doesn't.
hydrodog:
I mean when you write to a servo it waits until the motion is complete before execution goes on.
The standard servo library doesn't do that. When you call servo.write() it returns immediately and the servo will subsequently move to the new position. There's no position feedback from a standard servo so in fact the library couldn't tell when the servo had completed the movement even if it wanted to.
I hadn't done any this time around to show, but I've seen this numerous times:
This kind of code triggers one servo, then a second when the first is done. But since you're telling me it doesn't, I'm going to try this out and do the circuits myself, making sure they are powered external to the Arduino.
hydrodog:
This kind of code triggers one servo, then a second when the first is done
No, it absolutely doesn't. It explicitly moves both servos in incremental steps concurrently. It's not especially good code and looks to me as if it would get stuck after the first full cycle, but there is nothing there that demonstrates the problem you're describing.
sonique:
I believe that if you have this kind of problem, you must use a external microcontroller like Pololu servo controller.
Not at all. All that's doing is moving the servos at a controlled speed - it does not get any positional feedback from the servo and you can achieve just the same thing using an Arduino.
Write a new position that is only a small distance from the current position. Wait a while. Write a new position. Wait a while. Repeat as needed to get to the desired position. The longer you wait, the slower the servo moves.
Well, that seems simple enough to implement, if that's what you want
I'm not sure how simple this will be, for someone that can't even imagine how to control speed.
Personally, I think you, OP, are expecting too much of your servos.
Integrating acceleration into the Servo class will not be a trivial task. You'll need to know where the servo is at all times, to get speed to be part of the class. Incorporating acceleration will not be trivial. Keep in mind that the current Servo class supports more than just hobby servos. It supports continuous rotation "servos" (which really aren't servos) and ESCs, among other things. Not all of them will understand acceleration the same way.