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
Help AVSIM continue to serve you!
Please donate today!

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