Got it, I think (well it seems to work) :razz:
--Lua file to automatically disable the Yaw Damper when the AP is disconnected
--and enable it (to mirror the VC button) when z is pressed
--Dave Dewhurst
function setyawdamper(offset, AP_Master)
Yaw_Damper = ipc.readFLT(0x0808)
if AP_Master > 0 and Yaw_Damper == 0 then
ipc.writeFLT(0x0808, AP_Master)
elseif AP_Master == 0 and Yaw_Damper > 0 then
ipc.writeFLT(0x0808, 0)
end
end
event.offset(0x07BC, "FLT", "setyawdamper")
Oddly, I was expecting ON == 1 and OFF = 0
but on seemed = 1.405......e-45
so I just set it equal to AP_MAster which was the same value when on
Thanks again, it took less time than I thought
Dave