Cockpitbuilders.com

Arduino Projects => General Discussions => Topic started by: Stinger2k2 on February 09, 2017, 06:55:19 AM

Title: Need help with LUA script for altitude select knob
Post by: Stinger2k2 on February 09, 2017, 06: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.