JJRobots COMMUNITY
SOLVED !!! Reverse Servo in the Code - Printable Version

+- JJRobots COMMUNITY (http://forums.jjrobots.com)
+-- Forum: JJrobots (/forumdisplay.php?fid=1)
+--- Forum: B-Robot (/forumdisplay.php?fid=2)
+--- Thread: SOLVED !!! Reverse Servo in the Code (/showthread.php?tid=1880)



SOLVED !!! Reverse Servo in the Code - Bertl - 02-05-2019 09:13 PM

Hello
Can I reverse the servo in the code because mine strikes in the wrong direction.
I have everything structured like in the manual.
On the other side i have not enough Space.

Thank you
Robert


RE: Reverse Servo in the Code - JohnQ - 02-06-2019 09:58 PM

Easy fix: Use the Android control APP and connect the servo to the SECOND servo output. You can control it with the slider you will see on the bottom of the control screen.
I am not sure any CODE mod recommendation I can do here will work :-\ Sorry!


RE: Reverse Servo in the Code - Bertl - 02-07-2019 09:12 PM

Thanks for your tip john, of course, I have the servo already connected to the other connection !
However, I do not understand why it does not work for me, although I have everything structured as it should.
It must be possible to change the code and if there is no support, or someone who tells me, then I'll just try to find out on my own.

Thank you and im still waiting maybe someone can help me.

Robert


RE: Reverse Servo in the Code - Bertl - 02-09-2019 10:08 AM

Thank you all but I´ll find it out on my Own.

When Brobot lies and the Servo goes in the wrong direction then you must change these two Lines in the Code:

if (angle_adjusted > -40)
BROBOT_moveServo1(SERVO_MAX_PULSEWIDTH); // Original (SERVO_MIN_PULSEWIDTH);
else
BROBOT_moveServo1(SERVO_MIN_PULSEWIDTH); // Original (SERVO_MAX_PULSEWIDTH);

Greetings Robert Smile


RE: SOLVED !!! Reverse Servo in the Code - JohnQ - 02-11-2019 11:45 AM

(02-09-2019 10:08 AM)Bertl Wrote:  Thank you all but I´ll find it out on my Own.

When Brobot lies and the Servo goes in the wrong direction then you must change these two Lines in the Code:

if (angle_adjusted > -40)
BROBOT_moveServo1(SERVO_MAX_PULSEWIDTH); // Original (SERVO_MIN_PULSEWIDTH);
else
BROBOT_moveServo1(SERVO_MIN_PULSEWIDTH); // Original (SERVO_MAX_PULSEWIDTH);

Greetings Robert Smile
I was about to reply this thread with the EXACT lines modification. At the end, solving a challenge by your own has this "yeah!" felling :-)
I was thinking about your problem and looks like the servo you are using rotates backwards, differently to the standard SG90 or MG90 servos.
Good work anyways!


RE: SOLVED !!! Reverse Servo in the Code - Bertl - 02-11-2019 01:39 PM

Hello i`m using the Hitec HS-65MG Servo and maybe you are right .
Yes the feeling is good and it works perfectly !
I just wanted to write it if someone has the same problem.

Greetings Robert