i faced a problem when i take 1st angle movement and then delay(10000) for my current hobby servo, it will not stop at all within this 10sec. the servo will have a very tiny movement (1 time or 2 times) after each single angle movement.
this condition made my result have very significant changes even though just a tiny movement. i had change the difference size of servo motor. but the result still same.
there had a people recommend me to try “industrial strength” servo. can anyone help me to solve this problem or anyone know what the reason for this problem?
for your information, i will mount a reflection grating on my shaft, the grating is very light and will not make the burden for motor. The degree that i wanna the motor turn in 10degree, 11degree, 12degree , 13degree and 14degree. i need the motor totally stop in 10degree while waiting the delay period. i had attached my coding as below.
thank you.
[code]#include <Servo.h>
Servo myservo;
const int up = 2; // the number of the pushbutton pin
const int down = 3;
// variables will change:
int pressup; // variable for reading the pushbutton status
int pressdown;
void setup() {
myservo.attach(9);
pinMode(up, INPUT);
pinMode(down, INPUT);
}
void loop(){
// read the state of the pushbutton value:
pressup = digitalRead(up);
pressdown = digitalRead(down);
if (pressup == HIGH) {
// Servo move
myservo.write(10);
delay(10000); //it will not totally stop at 10 degree, in this waiting time, motor will have tiny movement.
myservo.write(11);
delay(10000);
myservo.write(12);
delay(10000);
myservo.write(13);
delay(10000);
myservo.write(14);
delay(10000);
}
if (pressdown == HIGH) {
// Servo off
myservo.write(0);
}
}[/code]