> 
> "Others"? Who? Where in the code should I look for it? What should I search
>  for?
> 
Me ;-)
But even simpler for the microcontroller: the internal representation neither 
khz nor mhz but channel. For the COMM, channel 0 is 118.000 Mhz and channel 
759 equals 136.975 MHz. The formula to convert from frequency to channel is
Channel = (Frequency_MHz - 118.0) / 0.025
and from channel to frequency:
Frequency_MHz = Channel * 0.025 + 118.0

For the NAV radio, the formula is
Channel = (Frequency_MHz - 108.0)/0.05
and reverse
Frequency_MHz = Channel * 0.05 + 108
resulting in channels from 0 - 199.

You only need a uint8_t (8-bit) variable for the NAV and a uint16_t (16bit) 
variable for the COMM part.

Send this as an INT with the generic protocol and use
<offset>A</offset>
<factor>B</factor>
within your <chunk>

offset and factor are used like
(output from flightgear): value_on_the_wire = property_value * factor + offset
and
(input to flightgear): property_value = value_on_wire * factor + offset

Torsten

------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to