BEST: Jittery Servos [Was: EasyC v4 - 4.0.2.7 Programming]

Cross link from EasyC Tech support to this forum:

I’ve seen this lots of times by beginning programmers for BEST.
Jittery servos are usually caused by multiple assignment statements, for example:

if (cond1) then  setmotor( 5, -127);
if (cond2) then setmotor(5, 0);

In the case of both cond1 and cond2 being true, the servo is trying to alternate between -127 and 0 every loop through the code, so it jitters.

The usual two solutions to implement single assignment are:
1: complete and mutually exclusive if/then/else block for set_motor
2: Any-old-code that eventually sets a variable to the desired servo position,
followed by a single execution group of setmotor( 5, var); at the bottom of the loop.

Note that only kingofl337 can reply to you on the EasyC support forum.
You’ll often get faster reponses from more people by posting to open forums, like the BEST forum, this forum;

Particularly if you post your code, or at least a screenshot of your code.

I would like to echo this, I see many questions on both EasyC and RobotC programming that could quickly be answered by other members if they were not posted in the “Official” forums.