Cockpit

* User Profile

Welcome, Guest. Please login or register.

Login with username, password and session length

Who's Online

  • *Users: 1
  • *Guests: 41
  • *Total: 42

FlightSimExpo 2018

Author Topic: Need help with LUA script for altitude select knob  (Read 474 times)

Offline Stinger2k2

  • CockpitBuilder
  • *
  • Posts: 14
  • Karma: +1/-0
  • Aviation Enthusiast
  • First Name: Keith
  • Home Location: Bexhill , England
Need help with LUA script for altitude select knob
« on: February 09, 2017, 10:55:19 AM »
Hi all,

I am trying to write a lua function to operate the altitude set knob. This is for a custom pit I am making for the Carenado Phenom 300.
I have been fine writing the code for custom on/off switches but I am struggling with this one.

The Phenom has a custom Lvar for operating the altitude set knob which is this
LVar: CUSTOM_AP_ALT_KNOB

When I operate the knob from with the autopilot of FS using a mouse in the virtual cockpit I
can see that the Lvar increments are +6 to increase the altitude or -6 to decrease. So for example for each click to increase
the altitude increases the Lavr and shows values such as 30,36,42,48 etc when I do a LINDA trace.

The values go in increments of 6 from 0-354 then start from zero again

How can I write the LUA code so that each pulse sent by my encoder increases or decreases the value by 6 ?

Hope this all makes sense to someone that can help !

many thanks for looking
Stinger. 


 

Recent Posts

Projectors or 4K Monitors?
by Philip
[February 18, 2018, 11:44:41 PM]
Visuals upgrade - inspiration needed
by Ed
[February 18, 2018, 11:36:53 PM]
Pedestal blanks / Fillers
by Atomic_Sheep
[February 18, 2018, 08:55:28 PM]
FSUIPC
by ifeliciano
[February 18, 2018, 07:47:31 PM]
Join me on Vatsim Tonight
by Bob Reed
[February 18, 2018, 05:55:23 PM]
MESH HELP
by Trevor Hale
[February 18, 2018, 03:10:35 PM]
737-800 Arduino X-Plane Build
by Trevor Hale
[February 18, 2018, 10:10:44 AM]
What have you done for your simulator today?
by 727737Nut
[February 18, 2018, 08:34:04 AM]
Wanted: Real Boeing 737 TQ
by Steenos
[February 17, 2018, 09:39:13 PM]
FlightSimExpo - June 9 - 10 2018
by James twomey
[February 17, 2018, 08:30:35 PM]
Fitting Forward Overhead Frame
by Ed
[February 17, 2018, 06:50:23 PM]
New Compass for King Air
by Joe Lavery
[February 17, 2018, 06:05:15 PM]
Well.... There is half! lol
by Trevor Hale
[February 17, 2018, 11:15:35 AM]
Post Your Pit!!!! 1000 Member Show and Tell
by Bob Reed
[February 16, 2018, 02:50:05 PM]
Attention All Members and Guests
by Trevor Hale
[February 16, 2018, 11:47:59 AM]
Hispa help....please
by Bob Reed
[February 16, 2018, 08:42:10 AM]
Marking wires
by Sam Llorca
[February 16, 2018, 06:22:10 AM]
Real Switch Amps
by Atomic_Sheep
[February 16, 2018, 04:40:54 AM]
REAL 737 TQ SORRY JUST SOLD!!!
by Trevor Hale
[February 15, 2018, 02:00:26 PM]
Aircraft config and question
by Patt737
[February 15, 2018, 01:46:34 PM]
B767 MIP
by kurt-olsson
[February 15, 2018, 11:14:07 AM]
Ultimate Traffic Live across a network
by jmlohrenz
[February 14, 2018, 06:45:35 PM]
Prepar3D v4.2 Now Available!
by Trevor Hale
[February 14, 2018, 02:43:59 PM]
Altitude warning
by jackpilot
[February 14, 2018, 11:50:00 AM]
DC3 measurements
by Sam Llorca
[February 14, 2018, 06:03:55 AM]
MIP IOcard and mother Card
by Captbrian
[February 13, 2018, 09:01:04 PM]
737-800 flight model
by blueskydriver
[February 13, 2018, 01:46:34 PM]