hello i was wandering if anyone knew how to reverse a servo when using a potentiometer. I have two servos at the base of my robot arm and one needs to be reversed. Any help would be great.
thank you!
hello i was wandering if anyone knew how to reverse a servo when using a potentiometer. I have two servos at the base of my robot arm and one needs to be reversed. Any help would be great.
thank you!
Your question is not understandable. Please read the first topic telling how to get the best from this forum.
there are two tower pro SG90 servos facing each other at the shoulder of a robotic arm and one needs to be reversed. I am using a potentiometer and i used a code very similar to the knob demo code. I have been trying for while and wandering if i should buy a servo reverser but i don't know how those work either.
Control the two servos with separate servo objects. Tell one to go to angle 'n' and the other to go to '180-n'.
No difference posting more word sallad.
Every servo runs forwards or backwords according to the parameters in the servo command.
"You used a code....." Do some work to understand what that code does, how it works. There are no simple plugins for unclear demands.
Using a potentiometer........ That can be done in a numerous ways.
One way is to regard the pot center value as zero. Pot values less than the zero point can be regarded as backwards, and the opposite.
i'm not sure what you mean.
Here is the code for the shoulder joint. Could you explain in more detail please. Sorry about the inconvenience. I have only started arduino a few weeks ago. Both the servos are controlled by the same potentiometer.
How about this:
void loop() {
valPot1 = analogRead(potpin1);
int servoAngle = map(valPot1, 0, 1023, 0, 180);
myservo1.write(servoAngle);
myservo2.write(180 - servoAngle);
delay(5);
}
Change one of the ".write(valPot1);" to ".write(180-valPot1);". Pick the one for the servo you want to "reverse".
Thank you!
I will try out your code and get back to you soon.
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.