Cockpit

* User Profile

Welcome, Guest. Please login or register.

Login with username, password and session length

Who's Online

  • *Users: 1
  • *Guests: 43
  • *Total: 44

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

Offline Stinger2k2

  • CockpitBuilder
  • *
  • Posts: 12
  • 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

Help needed with flap lever base on sairek
by lesdawson
[Today at 05:22:52 PM]
737 builds?
by maxmotoring
[Today at 04:09:09 PM]
Boeing 737-800 Next Generation Simulator
by Flying_Fox
[Today at 10:45:32 AM]
Mickey's Flightdeck - A Boeing 737-800 Cockpit on Youtube
by Extraterra
[September 18, 2017, 06:29:15 PM]
A WARNING ABOUT HISPAPANELS!
by bernard S
[September 18, 2017, 05:12:12 PM]
P3Dv4 NOT 64bit!
by Bob Reed
[September 18, 2017, 04:23:40 PM]
Looking for inspiration
by 737NGer
[September 18, 2017, 03:18:01 AM]
New supplier for your sim
by archen
[September 17, 2017, 01:34:01 PM]
XPlane and Avionics softwares.
by booky
[September 17, 2017, 12:15:23 PM]
737 Ng MIP PFD frame
by B747-400
[September 17, 2017, 03:41:56 AM]
OEM pneumatic panel
by jackpilot
[September 16, 2017, 08:21:53 AM]
FDS CDU and PM
by Garys
[September 16, 2017, 02:48:12 AM]
Landing lights PM aircraft
by Bob Reed
[September 15, 2017, 11:47:13 PM]
Opinions for Display
by captdini
[September 14, 2017, 02:12:02 AM]
Simfest West 2017
by Bob Reed
[September 14, 2017, 12:13:09 AM]
Boeing 767 Column Neutral Angle
by jonesthesoftware
[September 13, 2017, 01:57:40 PM]
Font height measurements -B737 Cockpit panels
by ElStino737
[September 13, 2017, 11:49:00 AM]
Scott (and Rob's...) Chicago 737-300 Build
by XOrionFE
[September 12, 2017, 08:36:15 PM]
WF17 Schedule
by FredK
[September 10, 2017, 12:21:04 PM]
setup views
by navymustang
[September 10, 2017, 09:48:05 AM]
WideView on Server without scenery addons ?
by brianwilliamson
[September 10, 2017, 02:16:13 AM]
OMG! Post Labor Day Check-In!
by Bob Reed
[September 09, 2017, 02:01:49 PM]
Tiller Steering Airbus
by geneb
[September 08, 2017, 09:20:50 AM]
ETOPS
by Fcoq
[September 07, 2017, 04:29:55 PM]
FDS Radios, Cargo Fire, and Flood panels (SOLD)
by XOrionFE
[September 06, 2017, 08:32:32 PM]
WEMAC air vents with backer (SOLD)
by blueskydriver
[September 06, 2017, 01:15:37 PM]
Wireless headset adaptor required
by ZK CWD
[September 06, 2017, 06:02:51 AM]
B767 aft circuit breaker panels
by Goodenough
[September 05, 2017, 10:55:31 PM]
Boeing 767 sidewall panels for sale
by Goodenough
[September 05, 2017, 10:48:39 PM]
Navigraph Charts Desktop
by navymustang
[September 05, 2017, 03:54:43 PM]