This is the format for calls to the function.nathanmalo wrote:can you just explain me this part of code:Function: We declare a new functionCode: Select all
function Panel_Light(control, Knob_in)
Panel_Light : function name
but, (control , Knob_in) , what is this and how to find it (with knob_out_last etc)?
control = what FSX control called the function. Only used if you may have several controls calling the
same function and you need to know which one made the current call. In all my scripts I have only one
'control' calling each script so I ignore this input.
Knob_in = the parameter (data) that is passed to the function by the control that called it. You define the
name so it is rather function specific for easy in understanding what you did 6 months from now
It is the data from your potentiometer, +/- 16384, that is passed.
Knob_out_last is just a name for a variable used inside the function so that the current scaled input (Knob_out) data
can be compared with the last scaled Knob_out data and if the 2 are the same, no need to display the change.
This keeps the Lua display from constantly displaying the value of Know_in, the potentiometer data, if
it hasn't changed.
I'm glad you got it working.
Happy Holidays!
Paul