Sign in to follow this  
Guest Patrick_Waugh

Finding deltas

Recommended Posts

Does anyone have a working callback that demonstrats how they are capturing a change (delta) in a FS value like an RPM or other FLOAT64 var?I'd like to be able to check on the rate of change of some vars, and not sure the best way to do this.I have tried something like this:

FLOAT64 FSAPI TorqueNeedle_cb(PELEMENT_NEEDLE pelement){	previousTorque = currentTorque;	currentTorque = pelement->source_var.var_value.n / 163.84;	deltaTorque = currentTorque - previousTorque;	return currentTorque;}
but, of course, the change at 18hz is very small, and I'm not sure this is a good approach.What are others doing?Patrick

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Well, you could use a timer to set your test interval......alternatively, sometimes a simple 'counter' will suffice! ;)if (count == 20){ count = 0; do_stuff ; count++ ; }

Share this post


Link to post
Share on other sites

Roman,Thanks, I know the meaning of Deltas in mathmatics.I probably forgot to mention in my original post but I'm working in C/C++, and so I'm looking for how others are doing it in C.But, that is a great topic for those using XML.Patrick

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this