Welcome to Cockpitbuilders.com. Please login or sign up.

March 28, 2024, 05:50:00 AM

Login with username, password and session length

PROUDLY ENDORSING


Fly Elise-ng
116 Guests, 0 Users
Members
Stats
  • Total Posts: 59,639
  • Total Topics: 7,853
  • Online today: 142
  • Online ever: 582
  • (January 22, 2020, 08:44:01 AM)
Users Online
Users: 0
Guests: 116
Total: 116

COUNTDOWN TO WF2022


WORLDFLIGHT TEAM USA

Will Depart in...

Recent

Welcome

Need help with LUA script for altitude select knob

Started by Stinger2k2, February 09, 2017, 06:55:19 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Stinger2k2

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. 


Like the Website ?
Support Cockpitbuilders.com and Click Below to Donate