Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Joystick Delay (http://www.chiefdelphi.com/forums/showthread.php?t=113635)

apalrd 22-02-2013 14:32

Re: Joystick Delay
 
Yes, that's what I meant.

There are occasionally While loops where timing really dosen't matter, but it can't eat the entire CPU running as fast as it wants.

I recently wrote some code for the Insight LT which uses I2C, and I don't particularly care how fast the data gets out as long as it takes at least 100ms to do so and dosen't block my high priority controls task. I basically ended up with an array of I2C transfers, and FOR'd through them all with a 2ms wait in each loop, so since I had 42 transfers it would definitely take at least 84ms to complete the write cycles. I did not wait for I2C verification since I really didn't care what happened (the worst case I have a funny screen image for 100ms), plus a 20ms wait at the beginning of the higher-level While loop.

The RT loops are definitely the best way to get good timing. Basically every FRC LabVIEW tutorial uses a Wait XXms as a method of controlling loop time and processor load, which does work but the timing performance is much worse.


All times are GMT -5. The time now is 21:46.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi