jmig
04-10-2008, 08:13 PM
I always knew I was a non entity when it came to programming. I just never knew how badly I sucked. I have been trying for two days to get one single little switch to do one simple little function, open and close the canopy.
I have read tutorials and looked at examples, all for naught. Here is what I need to do. I have a switch connected to a handle that I want to open and lower the canopy in FSX.
The switch is connected to the first pin on the master card and gives me 000 when closed in the OpenCockpits controller applet. So I know it and the MC are working.
I tried to use the IOCard config to have it change the status of offset $3367 within FSUPIC. The new FSX offset guide shows 3367 to be a single byte and it shows 2^0 = Exit1 & 2^3 = Exit4. I know that those are the bits to control different doors. However, I don’t know how to state 2^0 in SIOC or what the ^ means.
Using an example on making a switch turn on a LED I tried the following:
Var 0001, name canopySW, Link IOCARD_SW, Input 0, Type I
Var 0002, name canopy, Link FSUIPC_INOUT, Offset $3367, Length 1
IF &canopySW = 0 // If switch is OFF
{
&canopy = 0 // output is OFF
}
ELSE
{
&canopy = 1 // If not, output is ON
}
It too didn’t work. I feel embarrassed and frustrated that I can’t even get one little switch to work with FSUIPC and FSX. Can anyone help?
I have read tutorials and looked at examples, all for naught. Here is what I need to do. I have a switch connected to a handle that I want to open and lower the canopy in FSX.
The switch is connected to the first pin on the master card and gives me 000 when closed in the OpenCockpits controller applet. So I know it and the MC are working.
I tried to use the IOCard config to have it change the status of offset $3367 within FSUPIC. The new FSX offset guide shows 3367 to be a single byte and it shows 2^0 = Exit1 & 2^3 = Exit4. I know that those are the bits to control different doors. However, I don’t know how to state 2^0 in SIOC or what the ^ means.
Using an example on making a switch turn on a LED I tried the following:
Var 0001, name canopySW, Link IOCARD_SW, Input 0, Type I
Var 0002, name canopy, Link FSUIPC_INOUT, Offset $3367, Length 1
IF &canopySW = 0 // If switch is OFF
{
&canopy = 0 // output is OFF
}
ELSE
{
&canopy = 1 // If not, output is ON
}
It too didn’t work. I feel embarrassed and frustrated that I can’t even get one little switch to work with FSUIPC and FSX. Can anyone help?