Sign in to follow this  
Guest Skymed

Making a large increase into smaller increments

Recommended Posts

OkI need to add 2 A variables together (Ambient Wind and Ambient Temp) and input them to an L:Var. and then added to a gauge readout. This addition is only valid when certain parameters are present. Easy so far.Problem is, when they (the L:Var) are added to the gauge, there is an instantaneous jump in the needle as they get added to the readout, and an instantaneous drop when they are subtracted. So, my poor brain not being as tuned as I would like, needs to figure out a way of adding them slowly, to make the needle move up or down gradually, as opposed to jumping to reflect the addition of the new variable.I thought of a counter system (based on the update frequency) of something like this:(L:windtemp,enum) 1 + (>L:windtemp,enum)but how do I limit the count to be maxxed at whatever the addition of the wind and temp actually are, since wind and temp are always changing? i.e. If temp is 15 C and wind is 12 kts, added gives me 27, so I would need to stop the counter at 27: or wind 4 kts temp 5 C so I would need to stop it at 9.... well you get the picture........Any hints??Steve

Share this post


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

You don't mean a kind of damping? If yes try the code I posted some days ago. An exponential damping as described by me, dampens out fast changes, but slow changes are still let through.Arne Bartels

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