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.

Gear Lever from Axis - Have I done this correctly?

Featured Replies

I'm using the slider on the X-Touch Mini as a landing gear lever.

I have set up 3 detents with the following outputs:

Detent 1: Output 0 - Down position.
Detent 2: Output 64 - Off position if required.
Detent 3: Output 127 - Up position.

The output of the slider (0 to 127) is assigned to a variable L:Gear_LV_Pos.

I am then running the following script (just the UP and DOWN positions for the TBM) every 1000ms as an aircraft automated script:

(L:Gear_LV_Pos)·0·==·if{1·(>K:GEAR_DOWN)}
(L:Gear_LV_Pos)·127·==·if{1·(>K:GEAR_UP)}

Is this the correct way to do this, or is there a better way?

Thanks, Daz

On 12/23/2022 at 10:34 PM, Dazzlercee23 said:

I'm using the slider on the X-Touch Mini as a landing gear lever.

I have set up 3 detents with the following outputs:

Detent 1: Output 0 - Down position.
Detent 2: Output 64 - Off position if required.
Detent 3: Output 127 - Up position.

The output of the slider (0 to 127) is assigned to a variable L:Gear_LV_Pos.

I am then running the following script (just the UP and DOWN positions for the TBM) every 1000ms as an aircraft automated script:

(L:Gear_LV_Pos)·0·==·if{1·(>K:GEAR_DOWN)}
(L:Gear_LV_Pos)·127·==·if{1·(>K:GEAR_UP)}

Is this the correct way to do this, or is there a better way?

Thanks, Daz

 

Hi Daz,

what you have done is not wrong - but far from "best practice"

 

I recommend the following script:

x 127 / near (>K:GEAR_SET)

Save this script, then remove the "x" and instead press "Insert Script Var" - this will insert a variable that does contain the axis value (0..127). Dividing this value by 127 does give you a value between 0 and 1  - near is rounding to either 0 or 1. And then sending this value to the GEAR_SET event...

Click on Update after inserting the script variable!

Then in the Axis assignment select this script - and that's it. No need to create an aircraft automated script. You script will be triggered automatically on every axis level change...

 

This was the "general purpose" approach. Especially for the "Gear Up/Down" you can do even easier: 

Change Axis Min to 0, Axis Max to 1. Select "GEAR_SET" as event - and you're done, not even required to create your own script... 🙂

 

 

Regards,

Funatic

 

  • Author

Thanks, that's great.

I think I got hung up on the 'detents' thing.

Regards, 

 Daz

The important lesson here is to understand the role of the "Script Variable" - this is also available for events triggered from a button (the variable does reflect the number on the top right of the button assignment box). This allows you to remove the AutoScript for polling variable changes.

How to deal with that number in the script is then easy to do.

 

Regards,

Funatic

Edited by Funatic

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.