Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Heading Indicator not returning same result. Heading Displays 30 Dec but my code returns 18 Dec.

double Heading = 0;

double Variation = 0;

result = fsuipc.FSUIPC_Read(0x0580, 4, ref token, ref dwResult);

result = fsuipc.FSUIPC_Process(ref dwResult);

result = fsuipc.FSUIPC_Get(ref token, ref dwResult);

Heading = dwResult;

result = fsuipc.FSUIPC_Read(0x02A0, 4, ref token, ref dwResult);

result = fsuipc.FSUIPC_Process(ref dwResult);

result = fsuipc.FSUIPC_Get(ref token, ref dwResult);

Variation = dwResult;

Heading = Heading * 360 / (65536.0 * 65536.0);

Variation = Heading - (Variation * 360 / 65536.0);

if (Variation < 0)

{

Variation += 360;

}

else if (Variation > 360)

{

Variation -= 360;

}

textBox11.Text = String.Format("{0:#}", Variation) + " Dec";

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.