Hi everyone! First time posting on here, so tell me if I've made a mistake in the way I posted.
I've been making this robotic arm with multiple servos on top of an obstacle-avoiding rover, and a few days ago the codes for the arm stopped working properly. I thought, y'know, must be power or something, so I charged my LiPos until the charger showed they were alright and tested them out again today. Again, they worked alright for a few minutes before they just randomly stopped.
I've been testing them out with a Sweep code, and reading servo position tells me they're moving, but it's not physically moving, so I don't know.
#include <Servo.h>
Servo myservo;
Servo myservo2;
Servo myservo3;// create servo object to control a servo
// twelve servo objects can be created on most boards
int pos = 0; // variable to store the servo position
void setup() {
Serial.begin(115200);
//myservo.attach(42);
//myservo2.attach(41);
myservo3.attach(44);// attaches the servo on pin 9 to the servo object
}
void loop() {
//myservo.write(20);
//delay(250);
//myservo2.write(0);
//delay(250);
for(int i = 0; i <= 180; i++){
myservo3.write(i);
delay(15);
Serial.println(myservo3.read());
}
for(int i = 180; i >= 0; i--){
myservo3.write(i);
delay(15);
Serial.println(myservo3.read());
}
That's the code I've been trying out with. I have a separate power for all these Servos, and I've connected the GND of the battery with the GND of the servos and of the Arduino through breadboard. I'm operating an Arduino MEGA, any help or advice anyone? I can't see what I'm doing wrong.