Programming Gear Lights


Programming the gear lights is a simple task and there are a few ways to go about it. If you have ever noticed the gear of an aircraft, they rarely are in sync with each other. Usually the Nosegear is faster presumably because it is lighter and is able to traverse the distance easier than it's heavier counterparts.

In this example we have created the illusion that each gear traverses at different speeds, even if the flight model doesn't portray the difference. I have flown several FS2K flight models in which the gear indicators all turn on and off at the same time, which personally is not entirely realistic.

First, let's create aliases defining the physical connection to the 32-point output module:

The '0,0,0b00000010' lines define that in this example, the Right Wheel Down light is wired to Output Module 0, Row 0, Bit 2.

#define RW_Down 0,0,0b00000100
#define RW_Up
0,0,0b00001000
#define LW_Down 0,0,0b00000001
#define LW_Up 0,0,0b00000010
#define NW_Down 0,0,0b00010000
#define NW_Up 0,0,0b00100000

Next we'll set up the individual switches and the controlling routines to raise and lower the gear:

:GEAR_UP
{Enque16(Btnpulse, 8)}

:GEAR_DOWN
{Enque16(Btnpulse, 9)}

Here's the code to set the individual gear lights. Each is programmed individually, so the effect is somewhat more realistic. You'll soon notice that programming individual lights is a more complex task than setting the displays, or anything else for that matter.

:NS_UP{ delay(20) clearpoint(NW_Up) ;Nosewheel Up Lights Off
delay(60) clearpoint(LW_Up) ;Left Main Up Lights Off
delay(10) clearpoint(RW_Up)} ;Right Main Up Lights Off

:NS_Move{ clearpoint(NW_Down) Setpoint(NW_Up) ;Down Lights Off
clearpoint(LW_Down) Setpoint(LW_Up) ;Down Lights Off
clearpoint(RW_Down) Setpoint(RW_Up)};Down Lights Off

:NS_DOWN{ delay(10) clearpoint(NW_Up) Setpoint(NW_Down) ;Mains Down
delay(70) clearpoint(LW_Up) Setpoint(LW_Down)

delay(85) clearpoint(RW_Up) Setpoint(RW_Down)}

Lastly, the button routines and the QPROC calls to light the gear lights.

DefineButton(71, ON, GEAR_UP)
DefineButton(71, Off, GEAR_DOWN)

defineQproc(6, NS_DOWN) ;Turn on Gear down lights
defineQproc(7, NS_MOVE) ;Self Explanatory
defineQproc(8, NS_UP) ;Turn on Gear Up lights