How to set multiple servo positions?

Hello again! :slight_smile: I have four servos attached to an Arduino UNO board. When I'm typing my code, how do I program it to where each servo has a different starting position? Any help is appreciated!

When I'm typing my code, how do I program it to where each servo has a different starting position?

servo1.write(12);
servo2.write(45);
servo3.write(78);
servo4.write(99);

Thanks so much!! I'll give it a try. :smiley:

Perhaps surprisingly, you can write to a servo before you attach it.

That didn't quite work.
Let me restate, I need each servo to start at a different position. So even before I start the code I will have,let's say, servo1 positioned at 90 degrees. And once the code starts I want it to start from the servos position and rotate to wherever I programmed it to.

Let me restate.
Post code.

To the servo, there is no "before I start the code", there is only "where I was parked"

That didn’t quite work.

Yes, it did. It worked perfectly. That it did not do what you want is a problem with your expectations.

Now, if you tell us what your expectations are AND POST YOUR CODE we can help.

If cannot post the code at this time due to my camera. I'm still new at this guys so go easy. I'm not trying to be over expected, I trying to learn. I can't post the code at this time.

And my expectations are exactly this, I need the each different servo to start at a different angle. And then perform a rotation from that angle. Sorry for not understanding.

If cannot post the code at this time due to my camera.

Your camera ate your sketch? Why is your camera stopping you from posting your code?

I need the each different servo to start at a different angle.

The code I posted made that happen.

And then perform a rotation from that angle.

Then use variables to hold the starting positions, and increment the appropriate variable.

I got it now. Thanks so much for your help and I'm very sorry that I had higher expectations. In the future, I will try to think of something more easier and will try to learn easier.
And no, my camera did not eat my sketch. I cannot upload the code from my computer because im on my iPad and my computer does not have an internet connection. And my iPad camera refuses to take the picture.
Sorry for having a "problem" with my expectations. :slight_smile: