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.

Map and Axis to Incr/Decr Commands

Featured Replies

Thanks for the application - really changes the game!

I have been working on the Blackbird Corsair, specifically on the Supercharger handle.  I'd like to map an axis on my Honeycomb Bravo to the handle.  The handle has a Lvar (L:FG1D021) for position, but that, while settable, is not actually controlling the supercharger application, and is intended for output animation only.  I figured out that control is done via two events sent through the EVENTS_ID, and implemented a dirt simple script bound for the moment to a up/down toggle switch on the Honeycomb (the permanent "flap" switch over on the far right - NOT the axis at the far right).  The scripts are rather simply:

0x1101B (>L:EVENTS_ID,enum) // to decrement the handle (to neutral from low, or high to low)

0x1101A (>L:EVENTS_ID,enum) // to increment the handle (to low from neutral, or low to high)

The above does work to increment and decrement the handle, and the animated position of the handle moves as well without me having the set it.  FG1D021 gets set to 0, 50, or 100 depending on the increment/descrement.

What I'd love to do is map sending those events to the an axis.  I feel like I'd have to set a variable for the current state, though I suppose I could just read the enum or number value for FG1D021 lvar, and then do a comparison against where the axis is (LVAR is mapped 0 to 100 range). From what I can see using dev mode "Tools->Behaviors", the output is 0, 50, or 100 for the lvar.

So ...

if axis <25, and enum value is 50, then decrement once.  if enum is 100, decrement twice..

if 26-80 axis, and enum value is 0, then increment once.  If enum is 100, decrement once

if >80 axis, and enum value is 50, then increment once.  If enum is 0, increment twice.

I guess depending on how fast I move, it would really only ever decrement or increment once.  But regardless, I could write a routine like this in C, basic, fortran, and python.  But I can't for the life of me figure out how to do it in RPN script.  I am missing something obvious here methinks.  Anyway - if someone can point me in the right direction, I think I could figure it out. 

 

Thanks!

  • Commercial Member

I could offer a different solution.

1. Create the following script:
Group: Corsair
Name: SuperCharger
Code: (L:Corsair-SuperCharger)·50·*·(L:FG1D021,·Number)·<·if{·0x1101B·(>L:EVENTS_ID,·enum)·}·els{·0x1101A·(>L:EVENTS_ID,·enum)·}·

The Group and Script Name are important, because they determine the name of the "Script Variable" = the LVar at the beginning. OK? If you rename the group or the script, you have to rename the LVar accordingly (or use the "Insert Script Var" button). be mindful that AAOs RPN dialect is case sensitive.

2. Create an axis assignment to your phyiscal lever where you set Axis Min = 0, Axis Max = 2 and Rounding to "Int".

That should do the trick. What will happen is, that moving the lever will transmit the axis output value (0, 1 or 2) to the script through the script variable. The script then compares that variable times 50 to the position of the lever in the cockpit (which is 0, 50 or 100) and then sends either the up or the down event.

Edited by Lorby_SI

LORBY-SI

  • Commercial Member

Same can be done with the flaps lever:

Group: Corsair
Name: FlapLever
Code: (L:Corsair-FlapLever)·20·*·(L:FLAP_LEVER,·Number)·<·if{·0x11164·(>L:EVENTS_ID,·enum)·}·els{·0x11165·(>L:EVENTS_ID,·enum)·}·

Axis assignment in this case is Axis Min = 0, Axis Max = 5, Rounding "Int".
 

LORBY-SI

  • Commercial Member

And the tail hook

Group: Corsair
Name: TailHook
Code: (L:Corsair-TailHook)·(L:FG1D189,·Number)·<·if{·0x1111F·(>L:EVENTS_ID,·enum)·}·els{·0x1111E·(>L:EVENTS_ID,·enum)·}·

Axis assignment in this case is Axis Min = 0, Axis Max = 2, Rounding "Int".

LORBY-SI

  • Author

Thanks so much!  I'll give that a shot later, having a long flight at the moment in airliner.

  • Author

Update - these worked perfect - thanks!

Archived

This topic is now archived and is closed to further replies.

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.