Closing Switch Guards on Zibo Overhead Panel Toggle Switches

Support for Arduino in combination with Air Manager and Air Player

Moderators: russ, Ralph

Post Reply
Message
Author
old pilot guy
Posts: 30
Joined: Wed Dec 25, 2019 8:55 pm

Closing Switch Guards on Zibo Overhead Panel Toggle Switches

#1 Post by old pilot guy »

How are people closing the switch guards on the Zibo overhead panel switches?
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)
Last edited by old pilot guy on Wed May 19, 2021 8:43 pm, edited 1 time in total.

User avatar
Ralph
Posts: 7878
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Closing Switch Guard on Zibo Overhead Panel

#2 Post by Ralph »

I'm not sure what your question is exactly.

old pilot guy
Posts: 30
Joined: Wed Dec 25, 2019 8:55 pm

Re: Closing Switch Guard on Zibo Overhead Panel

#3 Post by old pilot guy »

If you control the overhead panel with a mouse or touchscreen and there is a switch with a cover plate(guard) that is open and the switch is off/
when you click or touch this, the switch moves to the on position and the cover plate(guard) closes. This does not happen with the Arduino attached.
Thanks

User avatar
Ralph
Posts: 7878
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Closing Switch Guards on Zibo Overhead Panel Toggle Switches

#4 Post by Ralph »

I think that there's a separate dataref or command for the guards. If you connect it to hardware then you would have to write both.

old pilot guy
Posts: 30
Joined: Wed Dec 25, 2019 8:55 pm

Re: Closing Switch Guards on Zibo Overhead Panel Toggle Switches

#5 Post by old pilot guy »

You are correct. Using the data ref tool I found the correct command. Some of the switch covers are toggle and others are buttons.
For the Zibo ELT Switch guard I added a button with the following lua:

Code: Select all

function button_pressed_callback()

    xpl_command("laminar/B738/button_switch_cover08", 1)

end

function button_released_callback()

    xpl_command("laminar/B738/button_switch_cover08", 0)

end

hw_button_add("Annunciator test button", button_pressed_callback, button_released_callback)
Works fine. I will leave the post up in the event it may help others.
Thanks

Post Reply