Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Get a Variable and How to Bind...

Featured Replies

I'd like to get the state of the Master Warn light for the Lear 35A. That way I can use an arduino that controls my physical cockpit and have it light up my master warn/caution button. At the time of the screenshot, the Master Warn was flashing, so the "Current Value" at the bottom of the picture was changing from 0 to 1. The issue is I can't tell the current value of what variable. Digging into the developer console (I'm new to all of this) I see the screenshot below. Is there a single variable I can check to see this flashing light? Thanks!

spacer.png

 

  • Commercial Member
5 hours ago, HadronFlux said:

Is there a single variable I can check to see this flashing light?

No, there isn't (not in this screenshot anyway). You would have to recreate the same script in AAO. But according to this behavior code you can't do this at all, because I: variables can't be accessed from the outside.

Edited by Lorby_SI

LORBY-SI

  • Author

Thanks a bunch - I figured that it would be inaccessible since there were none of the other types of variables involved. Thanks for your work - the app has been really helpful in making MSFS work with a cockpit build, being able to access as much as possible that just doesn't exist in the in game bindings screen.

  • Commercial Member
3 hours ago, HadronFlux said:

Thanks a bunch - I figured that it would be inaccessible since there were none of the other types of variables involved. Thanks for your work - the app has been really helpful in making MSFS work with a cockpit build, being able to access as much as possible that just doesn't exist in the in game bindings screen.

It is possible to do this, but it is a lot of work. You could replicate the logic that is providing the values for those I: variables and rebuild it in AAO. 

Their code is in the "CAUTION_ON_DISABLE" Component's  <UPDATE_CODE> tag in this behavior file:

flysimware-learjet-35a\ModelBehaviorDefs\Flysimware_L35A\Custom\Alerts.xml

Or, while you are there, alter the Alerts.xml and make it write the current state into your own LVar, in the EMISSIVE_CODE tag of the ANNUN_MASTER tags ( or ask FlySimWare to do it - I would guess that this this won't be the only "problematic" component?)

 

Edited by Lorby_SI

LORBY-SI

  • Author

Yeah, I'll give that a try - thanks a lot! I had posted in their Discord about it and the comment about editing the alerts.xml was brought up also (but with no details). I know this is an aside question - but AaO supports arduino devices via the CAN bus right? Currently I am using another project called BitsAndDroidsFlightConnector as it seemed to be the only one I could find that supports ESP32 (which I use to drive small round displays for gauges). I started to read through the CAN documentation but didn't do much with it as I wasn't sure ESP32 devices were ok and I kind of had another approach to pull a variable state out of the sim. In the back of my head I'm just wondering about how I can reduce the number of apps needed to make it all work and do it all in AaO. 🙂

  • Author

It worked! Here's the fruits of your labor: https://photos.app.goo.gl/JSKpZuL3wL7GKxXY8 

As I've just started this process of making my cockpit "dual plane" I don't know how many of these situations exist, but your example here will help me figure out how to do it in the future. Thanks again.

  • Commercial Member
7 hours ago, HadronFlux said:

that supports ESP32

Those ESP boards all have Wifi, right? In that case you could use the WebAPI of AAO. You would have to write a sketch that queries the desired variables from the WebAPI using a JSON structure. 

 

LORBY-SI

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.