# Continous Servo Issue

**URL:** <https://forum.arduino.cc/t/continous-servo-issue/1249945>\
**Category:** Motors, Mechanics, Power and CNC\
**Created:** [April 20, 2024, 2:36am UTC](https://forum.arduino.cc/t/continous-servo-issue/1249945 "2024-04-20T02:36:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![shivpat](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/shivpat/32/1098952_2.png) [@shivpat](https://forum.arduino.cc/u/shivpat)\
**Post date:** [April 20, 2024, 2:36am UTC](https://forum.arduino.cc/t/continous-servo-issue/1249945/1 "2024-04-20T02:36:51Z")

</div>

Hello,  
So I am using a Continuous Servo Motor with the Servo Library, except when I do the write() function, 0-90 doesn't change the speed when I alter the numbers in that range, it's just going "reverse" at a constant speed. But when I do 90-180, it changes.

Here is the documentation for this library: [Servo/docs/api.md at master · arduino-libraries/Servo · GitHub](https://github.com/arduino-libraries/Servo/blob/master/docs/api.md)

Here is my code:

```arduino
#include <Servo.h>
Servo myservo;

int pos = 0;

void setup() {
  // put your setup code here, to run once:
  myservo.attach(2);
  myservo.write(93);
  delay(1000);

  myservo.write(10);
  delay(500);
  myservo.write(93);
  delay(1000);
  

}

void loop() {
  // put your main code here, to run repeatedly:

}

```

Please help ASAP.

---

<div class="post-metadata">

**Author:** ![xfpd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xfpd/32/1120236_2.png) [@xfpd](https://forum.arduino.cc/u/xfpd)\
**Post date:** [April 20, 2024, 3:15am UTC](https://forum.arduino.cc/t/continous-servo-issue/1249945/2 "2024-04-20T03:15:24Z")

</div>

A continuous servo takes `myservo.write(90);` as a "stop"... less than 90 means "counterclockwise" and greater than "90" means "clockwise." The farther from "90", the faster. "0" means "full speed CCW" and "180" means "full speed CW."

> [@shivpat](#):
>
> Please help ASAP

No.

---

<div class="post-metadata">

**Author:** ![shivpat](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/shivpat/32/1098952_2.png) [@shivpat](https://forum.arduino.cc/u/shivpat)\
**Post date:** [April 20, 2024, 3:33am UTC](https://forum.arduino.cc/t/continous-servo-issue/1249945/3 "2024-04-20T03:33:40Z")

</div>

Forgot to mention. Thats another issue. At 90, it just keeps on moving. At 93, it stops

---

<div class="post-metadata">

**Author:** ![xfpd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xfpd/32/1120236_2.png) [@xfpd](https://forum.arduino.cc/u/xfpd)\
**Post date:** [April 20, 2024, 3:38am UTC](https://forum.arduino.cc/t/continous-servo-issue/1249945/4 "2024-04-20T03:38:22Z")

</div>

The values (for "center") will vary when using degrees.

To more accurately control a continuous servo use `writeMicroseconds();`

> **[Servo - writeMicroseconds() - Arduino Reference](https://www.arduino.cc/reference/en/libraries/servo/writemicroseconds/)**
>
> The Arduino programming language Reference, organized into Functions, Variable and Constant, and Structure keywords.

---

<div class="post-metadata">

**Author:** ![LarryD](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/larryd/32/215550_2.png) [@LarryD](https://forum.arduino.cc/u/LarryD)\
**Post date:** [April 20, 2024, 3:42am UTC](https://forum.arduino.cc/t/continous-servo-issue/1249945/5 "2024-04-20T03:42:03Z")

</div>

- Sounds okay.

---

<div class="post-metadata">

**Author:** ![JCA34F](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/jca34f/32/340148_2.png) [@JCA34F](https://forum.arduino.cc/u/JCA34F)\
**Post date:** [April 20, 2024, 3:53am UTC](https://forum.arduino.cc/t/continous-servo-issue/1249945/6 "2024-04-20T03:53:32Z")

</div>

Try this test program, connect servo signal wire to pin 9, forget degrees, enter numbers from 544 to 2400.

```arduino
/*
 Try this test sketch with the Servo library to see how your
 servo responds to different settings, type a position
 (544 to 2400) in the top of serial monitor and hit [ENTER],
 start at 1472 and work your way toward zero (544) 20 micros
 at a time, then toward 2400. 
*/
#include <Servo.h>
Servo servo;

void setup() {
  // initialize serial:
  Serial.begin(9600); // set serial monitor baud rate to match
                      // set serial monitor line ending to "NewLine"
  servo.write(1472); // should be stop position
  servo.attach(9);
  prntIt();
}

void loop() {
  // if there's any serial available, read it:
  while (Serial.available() > 0) {
    // look for the next valid integer in the incoming serial stream:
    int pos = Serial.parseInt();
    if(Serial.read() == '\n'){} //skip 1 second delay
    pos = constrain(pos, 544, 2400);
    servo.write(pos);
    Serial.print("microseconds = ");
    Serial.println(servo.readMicroseconds());
  }
}  

```

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [October 17, 2024, 3:54am UTC](https://forum.arduino.cc/t/continous-servo-issue/1249945/7 "2024-10-17T03:54:22Z")

</div>

Closed on October 17, 2024, 3:54am UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
