I hope this is in the right section, I apologize if it's not.
I'm having problems with a new more powerful servo I just purchased. I'm currently running the following sketch with the cheap SG90 servo provided by the Elegoo kit with no problem.
#include <Servo.h>
Servo servo;
void setup()
{
servo.attach(8); // HERE WE TELL ARDUINO WHICH PIN # THE SERVO IS ATTACHED TO
}
void loop() {
delay(0); // DELAY JUST MEANS WAIT. HOW LONG DO YOUWANT TO WAIT BEFORE THE NEXT ACTION
//
servo.write(0);
delay(1000);
servo.write(180);
delay(1000);
}
When I switch the servo to: RCD 35065S HS-5065MG High Torque Metal Gear Feather Servo
running the same sketch and have no movement.
When I run the provided sweep sketch the new servo works perfectly. Any idea why this isn't working?
Most servo problems come from inadequate power.
How are you powering the servo?
Note that attempting to power the servo from the arduino 5v pin is a bad idea.
It might work most of the time for a very small servo with no load on it.
But as soon as you attempt to use a larger servo, or put a load on the servo as it moves, you run into problems.
The only real difference between your code and sweep is that your code wants to go from 0 to 180 in one step, and sweep does it one degree at a time.
I wonder if it could still be a current issue then, that it somehow just manages to squeeze out 1 degree at a time but not the big movement? (That may be bullshit but as I say, that's the significant difference between the two sketches.)
I have an external power supply for the servo
How much current can it supply? Says here that servo is 1.2A at stall. Are your connections good for that?- if you use breadboard, maybe not....
A few things. When you post code, post it using code tags. So it looks like this:
#include <Servo.h>
Servo servo;
void setup()
{
servo.attach(8); // HERE WE TELL ARDUINO WHICH PIN # THE SERVO IS ATTACHED TO
}
void loop() {
delay(0); // DELAY JUST MEANS WAIT. HOW LONG DO YOUWANT TO WAIT BEFORE THE NEXT ACTION
//
servo.write(0);
delay(1000);
servo.write(180);
delay(1000);
}
Also, use autoformat CTRL-T
Also, remove white space.
These all make it easier to read the code, so easier for us to help you.
Now, like elvon_blunden I am still suspicious of your servo power.
Can you get a pen and paper, hand draw a wiring diagram of your arduino, the power supply and servo?
Then take a picture of the wiring diagram and post that picture here.