Code: Select all
-- This function will be called when new data is available from X-plane
function auto_throttle(auto_throttle_lt)
print("auto_throttle: " .. auto_throttle_lt)
local auto_throttle_lt_on = fif(auto_throttle_lt == 1, true, false)
hw_output_set(outp_id, auto_throttle_lt_on)
end
function capt_fd(capt_fd_lt)
print("capt_fd: " .. capt_fd_lt)
local capt_fd_lt_on = fif(capt_fd_lt == 1, true, false)
hw_output_set(outp_id, capt_fd_lt_on)
end
-- subscribe X-plane datarefs on the zibo
xpl_dataref_subscribe("laminar/B738/autopilot/autothrottle_arm_pos", "FLOAT", auto_throttle)
xpl_dataref_subscribe("laminar/B738/autopilot/flight_director_pos", "FLOAT", capt_fd)
outp_id = hw_output_add("auto_throttle_lt", false)
outp_id = hw_output_add("capt_fd_lt", false)