JJRobots COMMUNITY

Full Version: SOLVED !!! Reverse Servo in the Code
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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!
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
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
(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!
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
Reference URL's