0

I have a linear actuator that I am sending commands to via Visual C++. I want to do cycle testing with it (ie, extend, retract, extend, retract...). However, I want to slow down the rate at which Visual C++ sends the LA commands. The reason is that the commands are being sent too fast for the LA to respond.

Is it possible to "slow down" a C++ program?

moesef
  • 4,641
  • 16
  • 51
  • 68

1 Answers1

0

You might want to have a look at this answer here:

https://stackoverflow.com/a/902271/557748

Community
  • 1
  • 1
Justin Pearce
  • 4,994
  • 2
  • 24
  • 37
  • ok. trying the `Sleep(2);` function and its not working. the program builds but doesn't wait 2 seconds when encounter the function. – moesef Mar 01 '12 at 19:41
  • Is this being run on a PC or is this being compiled for a micro controller? – Justin Pearce Mar 03 '12 at 01:30
  • On a PC. does Sleep(2) cause the program to 'sleep' for 2 seconds or 2 milliseconds? If it is milliseconds, then I need to try Sleep(2000) and see if that works. I'll update you on whether or not that fixes the problem. – moesef Mar 03 '12 at 02:40