Jump to content
Sign in to follow this  
Barlow

Control Radio Panel via Keyboard - Aerosoft A320

Recommended Posts

Hello.

I want to control the radio panel of my Aerosoft A320 with my keyboard. I know that LINDA does not support keyboard inputs but I noticed that Linda developers have a lot of knowledge about LUA scripts which then can be used with FSUIPC for example.

Is there an availlable script to do that?

If not, how can I get this code to work?
I think I need something like a DspShow (x,y) function. I have seen it many times but can not find any documentation on it.

This is my code so far:

function com1_freq_swap ()
	local temp
	local LVarSet
	local LVarRead

	temp = ipc.readVar("L:Com1Freq")

	LVarSet = "L:Com1Freq"
	LVarRead = ipc.readVar("L:Com1StbyFreq");
	ipc.writeVar(LVarSet, LVarRead);

	LVarSet= "L:Com1StbyFreq"
	ipc.writeVar(LVarSet, temp)
end

function com1_freq_incr_1000 ()
	local LVarVal

	LVarVal = ipc.readVar("L:Com1StbyFreq")
	LVarVal = LVarVal+1000
	
	if LVarVal > 136975 then 
		LVarVal=LVarVal-18000
	end

	ipc.writeVar("L:Com1StbyFreq", LVarVal)
end

The first function should swap the Standby Freq with the Active Freq. But when I execute this function via FSUIPC nothing happens.

The second function should increase the Standby Frequency by 1 Mhz, for example from 119.000 Mhz to 120.000 Mhz. If this works, it should be easy to create a decrease function. 

As far as I know, there are two LVars for the Airbus A320. One called "L:Com1StbyFreq" which stores the respective frequency in the format "120000" and the second called "L:Com1StbyFreq_h" which uses the format "120.000".

Thank you very much for your help.

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...