Add Hardware with Arduino Mega Board

Let Sim Innovations know about your Air Manager experience and let us know about your dream feature addition

Moderators: russ, Ralph

Post Reply
Message
Author
DessieB
Posts: 1
Joined: Sat Nov 25, 2023 9:59 am

Add Hardware with Arduino Mega Board

#1 Post by DessieB »

Hi all, I am in the process of creating a monster switch/dial box so that I can control various switches, knobs, rotary knobs etc. I started with the basic Cessna 172 and am really happy with the result. I can control the mixture using a 50K potentiometer; the heading bug using a single encoder with push button option to set the heading sync, another single encoder to set the barometric pressure for the altimeter. The batteries, avionics, magnetos and engine start using a selection of momentary and fixed switches; the transponder, autopilot coms and nav radios. In short I can control everything on the Air manager panel with my button box. Inside is an Arduino Mega 2560 and a basic USB joystick card.

What I really like is that different panels can be programmed to use the same buttons, switches, potentiometers, and rotary encoders for different functions, meaning one big button box can control several different aircraft.

QUESTION
Now we get to the question/feature request. Although I like the basic Cessna with its dials etc, I prefer the Garmin G1000 glass panel version. As I am sure you are all aware there are two G1000 panels in the G1000 Cessna 172 Air Manager panel. Unfortunately, as far as I can tell, each of the two G1000s require a separate full set of buttons and knobs to control them. I can choose whether a set of buttons/knobs controls the Pilot PFD, the the Co-pilot PFD or the MFD but this would result in a massive amount of identical buttons to control the two G1000s. What I need is a button in the Generic - Garmin G1000 User properties that would switch a single set of buttons/switches/encoders between the three panels (I know there are only two panels in the G1000 version of the Cessna 172 but there are the options for panels in Air Manager). It could be a momentary push button that cycles between panels, or a three position switch. So, have I missed something or is this a feature request that I must wait for?

Thanks in advance.

User avatar
Keith Baxter
Posts: 4830
Joined: Wed Dec 20, 2017 11:00 am
Location: Gauteng

Re: Add Hardware with Arduino Mega Board

#2 Post by Keith Baxter »

Hi,

What you want can be done using a .json file.

You set up different parameters in the .json and then call the set to operate within the hardware function.


You could also just do something like this.

Code: Select all


--Button to step through modes.
mode_xpl = 1
mode_button = hw_button_add("Mode button", function()
   mode_xpl = mode_xpl + 1
   if mode_xpl > 3 then mode_xpl =1 end
end)   

-- Softkey 1
 Softkey_1 =  hw_button_add("Softkey 1",function()
 print( "We Are in mode       "..mode_xpl)
    xpl_command("sim/GPS/g1000n"..mode_xpl.."_softkey1")
end)


Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

Post Reply