Servo Help

Hey guys so Im using this code

#include <Servo.h>

Servo myservo;  // create servo object to control a servo
// twelve servo objects can be created on most boards


void setup() {
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object
  myservo.write(0);
  delay(3000);
 
}

void loop() {
  myservo.write(90);
  delay(3000);
  myservo.write(0);
  delay(3000);
  }

When I run the code on the HS-311 Servo the servo correctly turns 0 to 90 degrees. However when I use the HS-5055MG Servo the servo twitches and does a few random degrees and then stops working. Any help would be greatly appreciated!

Is this a continuation of the thread you started here?
Did you try the suggestion I posted there on reply #4?

Yeah sorry! But i actually think I figured it out for the most part. So I tried what you said and I found that using attatch.writeMicroseconds and set the PWM worked!

I do prefer writeMicroseconds over write. Greater granularity.

I am not sure it explains away all of the issue you were having, but it might. If you are giving it microseconds commands that fall within the rage of movement for the servo, it does explain it all (I think).

Edit: And YAY on you for getting it working!