I just set up some 180 degree servos on an Arduino Uno and ran the code below.
What happens when the servos hit the end of the 180 degree cycle (0 or 180) and the code keeps pushing them?
Will they burn up?
Is there code to end the servo when it gets to the end?
/*
Arduino Servo Test sketch
*/
#include <Servo.h>
Servo servoMain3; // Define our Servo 3
Servo servoMain5; // Define our Servo 5
void setup()
{
servoMain3.attach(3); // servo on digital pin 3
servoMain5.attach(5); // servo on digital pin 5
}
void loop()
{
servoMain3.write(45); // Turn Servo Left to 45 degrees
delay(1000); // Wait 1 second
servoMain5.write(0); // Turn Servo Left to 0 degrees
delay(1000); // Wait 1 second
servoMain3.write(90); // Turn Servo back to center position (90 degrees)
delay(1000); // Wait 1 second
servoMain5.write(135); // Turn Servo Right to 135 degrees
delay(1000); // Wait 1 second
servoMain3.write(180); // Turn Servo Right to 180 degrees
delay(1000); // Wait 1 second
servoMain5.write(90); // Turn Servo back to center position (90 degrees)
delay(1000); // Wait 1 second
}

