Random Servo pulse generator code

just been looking over the code. is there also a way of allowing time delays between moves and also a speed variation
'in a way where i can use each command type “Speed, Value & Delay” ,combined 'and on their own.

Can Pause be Variable?

let me explain.

Servo one will only require to move from one constant value to another with no variation in its distance traveled but it will require Delay variations between movement times AND variable Speed. Like eyes blinking… :slight_smile:

Servo two will require to move as the code already permits (random values), but will also require delay variations between movement times but with a constant speed

in Arduino it’s “delay();”
arduino.cc/en/Reference/delay

Yes, you can pass a variable to pause. We do this all of the time in the Phoenix (and other robot) code. In many cases we will set up a hardware timer, where we can count timer ticks (including overflows), so we can measure how much time has elapsed from one event to the next and use that information to set up delays…

You can setup the speed using the speed parameter on the command to the SSC-32, or you can choose to calculate this yourself and figure out how much time you wish for each move to make and use the T parameter on the SSC-32 command. Both ways should work.

Once you issue these commands, you can query the SSC-32 (lynxmotion.com/images/html/b … tm#qmovest) to see if the servo is still moving, or you can do like I mentioned above and do stuff in your code and measure time by timer counts and no when the SSC-32 should have finished your previous command to a servo…

Kurt