Dirk98 Posted March 26, 2013 Report Posted March 26, 2013 Guys, please help me out with 2 small lua files for VS Inc and VS Dec functions of FCU. I've collected most of the lua files needed to control principal FCU buttons and rotaries from the past discussions of Pete, guenseli and Kaptejnln. Luckily most of the examples of short single Luas made by Kaptejnln work just fine in AXExtended and I use them to control buttons and rotaries on FCU via FSUIPC. But for the life of me I can not figure out lua scripts for VS Increase and VS decrease, and actually VS is the last function that I need to map to my GoFlight modules. I'd greatly appreciate somebody posted the required text for the 2 luas here. Much thanks, Dirk.
Dirk98 Posted April 1, 2013 Author Report Posted April 1, 2013 Here you go, Dirk: -- VS/FPA switch buttonfunction switchHDGTRK (joynum, button, downup)ipc.writeLvar( "L:AB_AP_HDGTRK", 1 - ipc.readLvar("L:AB_AP_HDGTRK") )ipc.writeLvar( "L:SmallOverheadPushButtons", 1 )end-- VS/FPA Incfunction incFPAorVS ( joynum, button, downup )if ipc.readLvar("L:AB_AP_HDGTRK") == 1 then -- 1 = TRK/FPAlocal lFPA = ipc.readLvar( "L:AB_AP_FPA_Select2" ) + 0.1if lFPA > 9.9 thenlFPA = 9.9endipc.writeLvar( "L:AB_AP_FPA_Select2", lFPA )else -- 0 = HDG/SPD so set VSlocal lVS = ipc.readLvar( "L:AB_AP_VS_Select2" ) + 1if lVS > 60 thenlVS = 60endipc.writeLvar( "L:AB_AP_VS_Select2", lVS )endend-- VS/FPA Decfunction decFPAorVS ( joynum, button, downup )if ipc.readLvar("L:AB_AP_HDGTRK") == 1 then -- 1 = TRK/FPAlocal lFPA = ipc.readLvar( "L:AB_AP_FPA_Select2" ) - 0.1if lFPA < -9.9 thenlFPA = -9.9endipc.writeLvar( "L:AB_AP_FPA_Select2", lFPA )else -- 0 = HDG/SPD so set VSlocal lVS = ipc.readLvar( "L:AB_AP_VS_Select2" ) - 1if lVS < -60 thenlVS = -60endipc.writeLvar( "L:AB_AP_VS_Select2", lVS )endend-- VS/FPA Levelfunction levFPAorVS ( joynum, button, downup )if ipc.readLvar("L:AB_AP_HDGTRK") == 1 thenipc.writeLvar( "L:AB_AP_FPA_Select2", 0 )else ipc.writeLvar( "L:AB_AP_VS_Select2", 0 )endend-- register the buttons of your joystick triggering the functions-- replace joyletter by the actual used letter/number, also replace buttonX by the actual valueevent.button("joyletter", button1, 1, "incFPAorVS")event.button("joyletter", button2, 1, "decFPAorVS")event.button("joyletter", button3, 1, "switchHDGTRK")event.button("joyletter", button4, 1, "levFPAorV")[/CODE][color=#666600]Cheers,[/color][color=#666600]Dirk [/color] :D
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now