Pololu USB 16-servo controller: How to pause

Hi

this questions not sure how to do it.
Does Pololu allow me to pause for certain amount of second?
C #

Pololu(“COM4”,38400, ServoNum, ServoPos,ServoSpeed);
Pause for 5 seconts…
Pololu(“COM4”,38400, ServoNum, ServoPos,ServoSpeed);

etc…

I have tried using
Thread.Sleep(5000);

It works fine but it will stop everything else including the UI.

I could use Timer but not a good idea if I am sending 50 commands…

Any suggestions…?
The only thing I know is using Timer and Thread.Sleep.
Any other methods I can use?

Thank in Advance.

Hello.

I can think of two possible ways for you to do this in C#:

  1. Use a timer combined with a finite state machine. For example, put a big switch statement in the timer event function. Each time the timer event occurs, increment the state and then use that state variable to jump to the appropriate case of the switch statement. This case will transmit the command for that state and will then configure the timer for the next delay (this last part is only necessary if the next delay has a different duration than the previous).

  2. Create a new thread to send the commands to the servo controller. You can then pause this thread between commands using the Thread.Sleep function without pausing your program’s main thread (the one that controls the UI).

- Ben