Sign in to follow this  
Guest Steven007

How to set MACH speed in a C gauge

Recommended Posts

Mach speed is a decimal number.How can you set a specific MACH speed using trigger_key_event?Thge problem is that trigger_key_event takes a UINT32 parameter for the value to be set. Something like:trigger_key_event(KEY_AP_MACH_VAR_SET, 0.81);will never work because 0.81 is not an integer...Any clue?Thanks in advance !!Eric

Share this post


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

I haven't checked it, but maybe you should do it as follows: the maximum a UINT32 can be is the 32k number (don't know it exactly).0.81 = 81 / 100 as ? / 32k => ? = 81 * 32k / 100 = 0.81*32k.I think this should work.Greetings,Steven

Share this post


Link to post
Share on other sites

Eric,The values which you can use are between 0 and 65536, where 65536 is equal to m3.2 (the maximum you can set).m0.81 would be equal to .81/3.2 * 65536; or about 16589.Doug

Share this post


Link to post
Share on other sites

I am sorry if my question wasn't clear...In fact, I was talking about the Mach speed set on the autopilot, and I found the solution: you have to multiply the value by 100, which means you you to set a value of 81 to set an autopilot Mach speed of 0.81.Thanks !!Eric

Share this post


Link to post
Share on other sites

Oops, it's an unsigned INT. Sorry!Thanks for sharing the solution Eric!Steven

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