PDA

View Full Version : Using two outputs to simulate Boeing Vavles with an Open cockpits card(s) and Prosim737



capetonian
03-18-2010, 12:19 PM
Where Phidgets have the function to adjust the brightness of LEDS using software, the Open cockpits cards lack it. That is a bit of a bummer when trying to simulate the gauge valve lights.

But, there is a work around.... for each gauge you need two outputs, on each output a resistod for the led and a diode. The diode ensures that the current from output A does not interfere with output B and the other way around.

I splashed these together:
http://www.737ng.eu/070210/junction1.jpg

Once wired up I created the following bit of code for each gauge.

//Define Gauge movement

var 800 name CowlValveRight, Link IOCARD_OUT, Output 75 {
if v800 = 2
{
v775 = 1
v776 = 1
}
ELSE
{
v775 = 1
v776 = 0
}
}

The Prosim737 software sends either a 1 or a 0 to IOCP to indicate light state (off/on) and a 2 when the output in question is a valve. So I created a var (800) which represents the LED for the valve. Depending on weather a 1 or a 2 is sent the valve light is either dim or bright. You will have to play around with resistors though, Initially the difference between dim and bright was minimal, Now I have other resistors and I will be adding them soon.

Hope this helps, ... if anyone has any questions, please feel free to ask!

capetonian
03-18-2010, 06:30 PM
Just a quick change to the code:

// Cowl Anti Ice
var 800 name CowlValveRight, Link IOCARD_OUT, Output 75
{
if v800 = 2
{
v775 = 1
v776 = 1
}
if v800 = 1
{
v775 = 1
v776 = 0
}
if v800 = 0
{
v775 = 0
v776 = 0
}
}

Just making sure that the light is turned off if there is no signal coming through, . it seemed to stay on ofter two cycles of the valve, .. but working perfectly now.