Jump to content
Sign in to follow this  
mauri61173

hdg encoder assign offset lua

Recommended Posts

Hi

I'm building fcu using mobiflight and arduino. I can not attribute offset type 0x66C0 to the following function:

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

function AB_HDG_minus ()
    AB_hdgtrk = ipc.readLvar("L:AB_AP_HDGTRK")
    if AB_hdgtrk == 0 then
        LVarSet = "AB_AP_HDG_Select"
    else
        LVarSet = "Autopilot_TRK_set"
    end
    LVarGet = round(ipc.readLvar(LVarSet))
    AddVar = LVarGet - 1
    if LVarGet < 0 then
        AddVar = 359
    end
    DspHDG(AddVar)
    ipc.writeLvar(LVarSet, AddVar)
end

I'm using an encoder assign to increase or decrease the Hdg value on aerosoft airbus.

thanks in advance for the help

 

 

Edited by mauri61173

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