# 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 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 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 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 on other sites

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

## Create an account

Register a new account

• Tom Allensworth,
Founder of AVSIM Online

• ### Hot Spots

• Flight Simulation's Premier Resource!

AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!