While using serial control for servos it stop working after 2 or 3 instructions send Please help me out below is the code
#include <Servo.h>
Servo servoLeft; // Define left servo
Servo servoRight; // Define right servo
void setup() {
servoLeft.attach(10); // Set left servo to digital pin 10
servoRight.attach(9); // Set right servo to digital pin 9
Serial.begin(9600);
}
Also, if you want your system to be responsive you will need to get rid of all the delay()s and use millis() to manage timing as illustrated in several things at a time.
here is the complete code.
If a single servo is connected it works but after connecting two it stops working after 2 or 3 commands
#include <Servo.h>
Servo servoLeft; // Define left servo
Servo servoRight; // Define right servo
void setup() {
servoLeft.attach(10); // Set left servo to digital pin 10
servoRight.attach(9); // Set right servo to digital pin 9
Serial.begin(9600);
}
If a single servo is connected it works but after connecting two it stops working after 2 or 3 commands
Read #7 below about how to post your code. How are you powering your servos? Powering them from the arduino will not work if that is what you are doing.