Hi all ...
wish all of you doing well, and appreciate the help and support in advance ...
well; i am trying to make 3 servos move is a sequence.
therfor i thought if i make a function and use it is easier than making every time a servo check where is the location now and move smooth step-by-step in a certain speed to acheive the target degree.
i dont know where is my mistake ...
please help ...
I do. You didn't tell us what the code actually does, or if it even compiles. You didn't tell us what you expect the code to do. You didn't give us any clues needed to help you.
Oh ...
i wanted to move the servos to a certain angle.
no errors when i compile.
example :
when i want to move serve 1 to the angle : 90
i want to use the function as following :
stepservo(firstservo, 90, 15);
where the 15 is 15ms delay in each step
whats happening now is NOTHING
it dosent move the servos
while i tried a direct write(); and every thing connected well when it comes to connections.
What is the value that you read from the servo, in the function? It makes NO sense to try to use the value in a variable when you have no clue what that value is.
The read() method only returns the last value written to the servo. The first time you call the function, you have NOT written anything to the servo, so it does NOT make sense to ask the servo where it is.
great ... thanks ...
i asked the arduino to put out to the serial screen
and got that already in the needed angle
i moved a deferent values and all working fine