Jump to content
Sign in to follow this  
spokes2112

Direct Tune of COM1 Standby, etc.

Recommended Posts

I am designing an RTU4200 control head.There are two of 'em used, one strapped for COM1/NAV1 and another strapped for COM2/NAV2.FS stock key_events only allow for direct tuning of either COM1 (active) OR COM1 Standby frequency, depending on how the radio section of the aircraft.cfg is set up.I need to be able to tune the COM1 Standby directly...I'm thinking that I should be able to use the KEY_COM_STBY_RADIO_SET event to do the deed, based on the contents of my own, custom "tuning variable" but haven't been successful so far...I'm open for suggestions... ;)


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

Fr. Bill,Did you try the Horner Schedule?(See FAQ Arne Bartels)XMLany frequency100 * 10000 % intd 10 % r 10 / intd 10 % r 10 / intd 10 % r 10 / int16 * +16 * +16 * +(>K:COM_STBY_RADIO_SET)Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Hi Bill (L:SetValue, number) 100 * 10000 % int d 10 % r 10 / int d 10 % r 10 / int d 10 % r 10 / int 16 * + 16 * + 16 * + (>K:COM_STBY_RADIO_SET) Maybe this is what you need, It works OK for me.


Paul EGLD

Share this post


Link to post
Share on other sites

Thanks for the suggestions. Actually, I have managed to do the deed in C using a combination of bits and pieces from other code I've already written...The main problem was that I couldn't remember just what I'd written a year ago, and scratched my head wondering "Now why did it do that..." :-lol What makes it rather complex is that the same knob is used for all tuning functions, and what the outer and inner knob do is based on what LSK happens to be selected...Plus, the knob has to account for 'rollover' when reaching the upper or lower limits, which of course is different for COM and NAV frequencies...Anyway, I think it's done now... :)For example, NAV1 Standby direct tuning of decimals:if ( rtu_lsk1 == 6 ) { if (rtu_innerknob1 == 1 && NAV_stby < 117.95) { NAV_stby = NAV_stby + 0.025; trigger_key_event (KEY_NAV1_STBY_SET,Dec2Bcd((NAV_stby - 100)*100)); rtu_innerknob1 = 0; } else if (rtu_innerknob1 == 1 ) { NAV_stby = 118.00 ; trigger_key_event (KEY_NAV1_STBY_SET,Dec2Bcd((NAV_stby - 100)*100)); rtu_innerknob1 = 0; } if (rtu_innerknob1 == -1 && NAV_stby > 108.00) { NAV_stby = NAV_stby - 0.025; trigger_key_event (KEY_NAV1_STBY_SET,Dec2Bcd((NAV_stby - 100)*100)); rtu_innerknob1 = 0; } else if (rtu_innerknob1 == -1 ) { NAV_stby = 136.975 ; trigger_key_event (KEY_NAV1_STBY_SET,Dec2Bcd((NAV_stby - 100)*100)); rtu_innerknob1 = 0; } }


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

The main problem was that I couldn't remember just what I'dwritten a year ago, and scratched my head wondering "Nowwhy did it do that..." :-lol Bill, don't scratch too hard... It could get infected.. :-lolI just had to............ :-beerchug Roman


20AUG21_Avsim_Sig.png?dl=1  FS RTWR   SHRS F-111   JoinFS   Little Navmap 
 

 

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  

  • Tom Allensworth,
    Founder of AVSIM Online


  • 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!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...