Jump to content
Sign in to follow this  
aerostar

Rotary HDG, SPD, CRS auto increase step

Recommended Posts

 

Trying to make the HDG rotary increase step from -    1 deg per click to 10 deg per click -    automatically when turning the rotary after a set  number of  deg's have occured in a given time.

Here is a sample of the LUA   actions.lua    script from LINDA website for the Aerosoft Airbus A320 that I've been trying to alter with no success (I am not a programmer).

Can anyone help please......

This the original for HDG plus  ,  there is also one for HDG plusfast but you need to manually trigger which one to select

_________________________________________________________

function AB_HDG_plus ()
    AB_hdgtrk = ipc.readLvar("AB_AP_HDGTRK")
    AB_drift = round(ipc.readLvar("AB_AP_HDGTRK"))
    if AB_hdgtrk == 0 then
        LVarSet = "AB_AP_HDG_Select"
    else
        LVarSet = "AB_AP_TRK_set"
    end
    LVarGet = round(ipc.readLvar(LVarSet))
    AddVar = LVarGet + 1
    if AddVar > 359 then
        AddVar = 0
    end
    DspHDG(AddVar)
    ipc.writeLvar(LVarSet, AddVar)
end

 

Here is one of my inept attempts at altering it.....

_______________________________________

function AB_HDG_plus ()
    AB_hdgtrk = ipc.readLvar("AB_AP_HDGTRK")
    AB_drift = ipc.readLvar("AB_AP_HDGTRK")
    if AB_hdgtrk == 0 then
        LVarSet = "AB_AP_HDG_Select"
    else
        LVarSet = "AB_AP_TRK_set"
    end
    LVarGet = ipc.readLvar(LVarSet)
    if (LvarGet - val1) > 20 then
    AddVar = LVarGet + 10
    else
    AddVar = LVarGet + 1
    if AddVar > 359 then
        AddVar = 0
    end
    --DspHDG(AddVar)
    ipc.writeLvar(LVarSet, AddVar)
    end
    val1 = LVarGet
    sleep(200)
end

event.flag(1, "AB_HDG_plus")

_________________________________

My general idea is when the rotary turns,  a reading is taken of the HDG degrees at that time

then   ie   200ms  later a reading is taken again and if the difference is over   ie  15 deg  it sets the rotary to step 10deg per click instead of 1deg step per click. As soon as the sample is less than 15deg diff then it steps back to 1deg per click.

This should be easy for someone with a bit of LUA knowledge to do (I think)

Thanks for any help


                        mustang_banner_newstar2777.png

 


 
 
 
 

Share this post


Link to post
Share on other sites

.... my latest attempt using   "event.timer"  but any iterations and many different tries later it still doesn't work   

3c45a04670292a8bfe3b841c90c05dca.png

Can't figure out how the event.timer is used in this...  among other things

Edited by aerostar

                        mustang_banner_newstar2777.png

 


 
 
 
 

Share this post


Link to post
Share on other sites

On the AS A320 the  rotaries are push/pull so I really need to free up the push button on my rotaries....   been looking for someone to make the speed accelerate for ages. 

It doesn't seem like it would be any kind of challenge for someone who has even a basic understanding of LUA  and really would be great if it was already an option in LINDA and the LUA actions  script.

Edited by aerostar

                        mustang_banner_newstar2777.png

 


 
 
 
 

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