Cockpit

* User Profile

Welcome, Guest. Please login or register.

Login with username, password and session length

Who's Online

  • *Users: 2
  • *Guests: 49
  • *Total: 51

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

Offline Stinger2k2

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

New AFT OVH
by fsaviator
[April 23, 2017, 08:13:39 PM]
Oasis 737 Project
by 737NGer
[April 23, 2017, 04:52:24 PM]
Engravity glarewings set for sale
by scojj
[April 23, 2017, 06:00:01 AM]
CPFlight MIP board
by scojj
[April 23, 2017, 05:57:42 AM]
CPFlight MIP737ICS and project magenta : gauges issue.
by scojj
[April 23, 2017, 05:54:18 AM]
Life of a Veteran Airplane
by iwik
[April 22, 2017, 04:09:57 PM]
Boeing 737NG parts: OVH, MIP and Yoke
by rtopinka
[April 21, 2017, 06:41:23 PM]
SEP/MEP 3DOF motion simulator for sale
by rtopinka
[April 21, 2017, 05:09:36 PM]
Cockpit Parts
by goirishgo1083
[April 20, 2017, 02:52:50 PM]
Rotary with a button
by Atomic_Sheep
[April 19, 2017, 11:49:52 PM]
737NG Single Seat Trainer "Starter Kit" :-)
by blueskydriver
[April 19, 2017, 10:43:37 PM]
X-Plane 11 multi-monitor & Fly Elise-ng - tuto
by pierrevw
[April 18, 2017, 05:48:32 PM]
KIng Air yokes
by RayS
[April 18, 2017, 05:40:03 PM]
I Need A Particular Photo.......
by FredK
[April 17, 2017, 03:05:10 PM]
Looking for FDS G2 EFIS Unit
by Trevor Hale
[April 17, 2017, 02:56:23 PM]
737 Overhead frame.
by kurt-olsson
[April 17, 2017, 01:17:07 PM]
B737 Startswitches
by airupthere
[April 17, 2017, 11:10:19 AM]
737 MIP captains side
by MrMikaelEricsson
[April 17, 2017, 02:37:18 AM]
10.4 LCD Source?
by rprather
[April 16, 2017, 08:08:50 PM]
Captain Joe Videos...very informative!!!
by Flying_Fox
[April 16, 2017, 05:39:04 PM]
Boeing 737 700/800 QRH
by bernard S
[April 15, 2017, 04:25:53 PM]
Phidgets Advanced Servo 8-Motor Card
by pierclav
[April 14, 2017, 11:12:41 PM]
XML lvars & LEDs
by jmcmanna
[April 14, 2017, 10:03:48 AM]
Could anyone use this 757 TQ stand??
by bernard S
[April 14, 2017, 09:02:02 AM]
Open Cockpit Radios: Tuning frequency from ATC programs ?
by brianwilliamson
[April 13, 2017, 08:53:28 PM]
Wanted: 737 MIP Captain side
by MrMikaelEricsson
[April 13, 2017, 11:51:35 AM]
GoPro
by Bob Reed
[April 12, 2017, 10:18:40 PM]
Correct B737 MIP dimensions?
by MrMikaelEricsson
[April 12, 2017, 02:16:11 PM]
My adaptation to Saitek's real-scale Embraer Phenom 100 or 300!
by eduardohbm
[April 12, 2017, 01:39:47 PM]
New member
by Fcoq
[April 12, 2017, 06:09:42 AM]