Jump to content
The simFlight Network Forums

Leaderboard

Popular Content

Showing content with the highest reputation on 12/06/2020 in all areas

  1. The Hz/int offsets are already working for reading, for writing a 8.33 frequency I'm using a workaround by setting the frequency to the nearest lower 25kHz frequency via the standard radio offsets and then calling the control for radio increase until it matches the correct 8.33 frequency. This works quite well. Simplified example based on C#, but should be easily adaptable to LUA or any other language: double freq = 122.385; // example freq int freqKhz = (int)(freq * 1000); // 122385 int nextSmaller25 = (freqKhz / 25) * 25; // 122375 int remainder25 = freqKhz % 25; // 10 int steps = remainder25 / 5; // 2 if (nextSmaller25 >= 118000 && nextSmaller25 < 137000 && steps <= 3 && remainder25 % 5 == 0) // is valid 8.33 freq? { string legacy4digit = nextSmaller25.ToString().Substring(1, 4); // 2237 => write legacy4digit as BCD to COM offset (e.g. to 0x311A for COM1 standby) for (int i = 0; i < steps; i++) // 2 times { => call control for radio fract increase, e.g. 65639 (COM_RADIO_FRACT_INC) for COM1 } }
    1 point
  2. 0 points
  • Newsletter

    Want to keep up to date with all our latest news and information?
    Sign Up
×
×
  • 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.