Quick Question About Servo

Hello to everyone.I have a standard servo and my question is the command myservo.write(90); stops the servo completely?i am newbie.Thanks in advance

That's what I would expect it to do. Presumably if you try myservo.write(60); it will stop at a different position.

...R

The command myservo.write(90); stops the servo completely amd hold the position or the servo go to center and then stop?Sorry but i don't find a straight answer.If anyone knows please reply.Thanks in advance

90 is the centre, since most servos are 0-180 degrees.

Strictly speaking a servo.write(90) actually under the hood converts that to being the same as servo.writeMicroseconds(1500), since it's actually the pulse width the servo is looking for, not an absolute position in degrees.

Once the servo.write() or servo.writeMicroseconds() has been performed, the servo library sends that same pulse every 20ms so that the servo is "reminded" and holds its position.

If on the other hand, your servo wasn't a standard servo but a continuous "servo", then servo.write(90) (or maybe somewhere from 88-92 or so) commands the servo to stop, but you have no control over exactly where the servo will be, degree-wise, when it does stop.

Sorry but i don't find a straight answer.If anyone knows please reply.Thanks in advance

Very simple servo test code you can use with the serial monitor to send position commands to the servo.

//zoomkat 7-30-10 serial servo test
//type servo position 0 to 180 in serial monitor
// Powering a servo from the arduino usually *DOES NOT WORK*.

String readString;
#include <Servo.h> 
Servo myservo;  // create servo object to control a servo 

void setup() {
  Serial.begin(9600);
  myservo.attach(9);
  Serial.println("servo-test"); // so I can keep track of what is loaded
}

void loop() {

  while (Serial.available()) {
    char c = Serial.read();  //gets one byte from serial buffer
    readString += c; //makes the String readString
    delay(2);  //slow looping to allow buffer to fill with next character
  }

  if (readString.length() >0) {
    Serial.println(readString);  //so you can see the captured String 
    int n = readString.toInt();  //convert readString into a number
    Serial.println(n); //so you can see the integer
    myservo.write(n);
    readString="";
  } 
}

jack1992:
The command myservo.write(90); stops the servo completely amd hold the position or the servo go to center and then stop?Sorry but i don't find a straight answer.If anyone knows please reply.Thanks in advance

Did you read and consider Reply #1

...R

ok thank you.