Hi all, i am new to arduino. Please help.
I want my servo motor to rotate 90 degree and after 3 seconds it will turn back to its original position which is -90 degree. It will turn 90 degree and turn back perfectly but not in excalty 3 seconds. Sometimes takes 5 seconds, 3, seconds, 7 seconds. Why ?? Below is my simple coding.
Servo myservo; // create servo object to control a servo
myservo.attach(9); // attaches the servo on pin 9 to the servo object
Serial.begin(9600); //begins serial communication
pos=Serial.read(); //reads the value sent from Visual Basic
myservo.write(-90); //rotates the servo 90 degrees (right)