Here is an example of the ELT Switch Lua that seems to work for this newbie.
Thanks
Code: Select all
function switch_callback(position)
if position == 1 then
print("switch up")
xpl_command("laminar/B738/toggle_switch/elt_on")
elseif position == 0 then
print("switch down")
xpl_command("laminar/B738/toggle_switch/elt_arm")
end
end
hw_switch_id = hw_switch_add("ARDUINO_MEGA2560_A_D49", switch_callback)