Air Manager - MSFS 2020 - Complex Lvars

Support for Arduino in combination with Air Manager and Air Player

Moderators: russ, Ralph

Post Reply
Message
Author
User avatar
PilotOlivier
Posts: 12
Joined: Sun Aug 07, 2022 7:17 pm

Air Manager - MSFS 2020 - Complex Lvars

#1 Post by PilotOlivier »

Hi Team

I have the project to build a KingAir 350i home cockpit with MSFS 2020, Arduino and Air Manager.

After spending a lot of time, I can't find the answer to my problem. On the same computer, I have :

- MSFS2020
- FSUIPC (latest registered version)
- Air Manager (latest registered version)
- SPAD.neXt (latest registered version)
- Arduino MEGA2560 (original board)

I would like to use Air manager to manage a Avionics Master Switch (complex routine) which works with SPAD.neXt.
image.png
image.png
image.png (11.2 KiB) Viewed 1894 times

What is the routine for reproducing this action with Air Manager?

Thank you by advance for your support.
Pilot Olivier

MSFS 2020 - KIng Air 350i - Steam Gauge Overhaul - Analog King Air
Air Manager - SPAD.neXt
Arduino MEGA2560

User avatar
Sling
Posts: 5237
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: Air Manager - MSFS 2020 - Complex Lvars

#2 Post by Sling »

You just need to setup your switch or button callback to send those same events using fs2020_event(). See the relelevant wiki page for details.

JackZ
Posts: 2262
Joined: Mon Feb 22, 2016 1:02 pm

Re: Air Manager - MSFS 2020 - Complex Lvars

#3 Post by JackZ »

For the Avionics master switch on the KA 350i, a mere

Code: Select all

fs2020_event("TOGGLE_AVIONICS_MASTER")
seems to be working as expected.

Why do you want to setup complex electrical buses like in the SPAD Next code?

As per using the stock KA 350i in MSFS for a home cockpit, it appears to be a frustrating experience, since a LOT of switches/functions are NOT implemented, unless you are using a specific addon?
[EDIT]
Is it the Just Flight Black Square Steam gauge mod? In that case, it's a different story, but since I don't have it, can't be of too much use, sorry.
But you could try something like this (Have no ways to test it, since I don't have the addon)

Code: Select all

fs2020_variable_write("L:VAR_AVIONICSMASTERSWITCH","INT",1)
fs2020_event("ELECTRICAL_BUS_TO_BUS_CONNECTION_TOGGLE",17,4)
fs2020_event("ELECTRICAL_BUS_TO_BUS_CONNECTION_TOGGLE",19,2)
fs2020_event("ELECTRICAL_BUS_TO_BUS_CONNECTION_TOGGLE",21,3)
fs2020_event("ELECTRICAL_CIRCUIT_TOGGLE",131)
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

User avatar
PilotOlivier
Posts: 12
Joined: Sun Aug 07, 2022 7:17 pm

Re: Air Manager - MSFS 2020 - Complex Lvars

#4 Post by PilotOlivier »

HI JackZ

Thank you for your reply and your help. I've been working on this and here's my feedback which may help home builders

Yes, I use the mod "Just Flight Black Square Steam gauge" which is really better than the MSFS version.

Here's the routine that works well:

-- ARDUINO_NANO_A_D2 / Avionics Master

function switch_NANO_A_D2(Position_Switch)
if Position_Switch == 1 then
fs2020_variable_write("L:VAR_AVIONICSMASTERSWITCH","INT",0)
fs2020_event("ELECTRICAL_BUS_TO_BUS_CONNECTION_TOGGLE",17,4)
fs2020_event("ELECTRICAL_BUS_TO_BUS_CONNECTION_TOGGLE",19,2)
fs2020_event("ELECTRICAL_BUS_TO_BUS_CONNECTION_TOGGLE",21,3)
else
fs2020_variable_write("L:VAR_AVIONICSMASTERSWITCH","INT",1)
fs2020_event("ELECTRICAL_BUS_TO_BUS_CONNECTION_TOGGLE",17,4)
fs2020_event("ELECTRICAL_BUS_TO_BUS_CONNECTION_TOGGLE",19,2)
fs2020_event("ELECTRICAL_BUS_TO_BUS_CONNECTION_TOGGLE",21,3)
fs2020_event("ELECTRICAL_CIRCUIT_TOGGLE",131)
end
end

hw_switch_add("ARDUINO_NANO_A_D2", switch_NANO_A_D2)

Finally, my idea is to use Air Manager only and not SPAD.neXt .... - that's why I'm asking the Air Manager Community!
Pilot Olivier

MSFS 2020 - KIng Air 350i - Steam Gauge Overhaul - Analog King Air
Air Manager - SPAD.neXt
Arduino MEGA2560

User avatar
samburner3
Posts: 16
Joined: Thu Apr 16, 2020 9:29 am
Location: Australia

Re: Air Manager - MSFS 2020 - Complex Lvars

#5 Post by samburner3 »

Does AM even support writing lvars?

Code: Select all

fs2020_variable_write("L:VAR_AVIONICSMASTERSWITCH","INT",1)
In the wiki it mentions subscribe (read lvars) but no mention of writing them...

Did the above peice of code work for you??

I am trying to find out; https://siminnovations.com/forums/viewtopic.php?t=7828

Post Reply