Writing Joystick Code: Part 2: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 90: Line 90:
  U
  U
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
  Aileron Trim left NR
  Aileron trim left NR
   interpolate("/controls/flight/aileron-trim", -1, 30 * (1 - getprop("controls/flight/aileron-trim")))
   interpolate("/controls/flight/aileron-trim", -1, 30 * (1 - getprop("controls/flight/aileron-trim")))
  U
  U
   interpolate("/controls/flight/aileron-trim", getprop("controls/flight/aileron-trim"), 0)
   interpolate("/controls/flight/aileron-trim", getprop("controls/flight/aileron-trim"), 0)
 
  Aileron trim right NR
  Aileron trim right NR
   interpolate("/controls/flight/aileron-trim", 1, 30 * (1 - getprop("controls/flight/aileron-trim")))
   interpolate("/controls/flight/aileron-trim", 1, 30 * (1 - getprop("controls/flight/aileron-trim")))
Line 161: Line 161:
  step magnetos
  step magnetos
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
   
   
If you find a line is too long for your page width, then you can press Enter and go to a new line. FG will be happy - it needs a tag or a ; at the end of a line to tell it that the current line of code is finished.
If you find a line is too long for your page width, then you can press Enter and go to a new line. FG will be happy - it needs a tag or a ; at the end of a line to tell it that the current line of code is finished.
Line 169: Line 170:
Notice the choice of place to press Enter, and the indent in the second line. Make it ''easy'' for people to read.
Notice the choice of place to press Enter, and the indent in the second line. Make it ''easy'' for people to read.


-----------------------------------------------------------------------------
Go back to [[Writing Joystick Code: Part 1]].
-----------------------------------------------------------------------------




224

edits