sboons
10-08-2009, 07:26 AM
Hi again,
David helped me out with my problem showing heading on my sim-avionics.
Now I have the following problem:
I have a SIOC script to change my heading.
The goal of this script is only to change the heading bug on my virtual cockpit in FSX.
I have a CTS288 grey encoder from opencockpits, connected on the mastercard inputs 3 and 4 (and gnd off course)
When I look at the Controlador software, and turn the encoder I see:
RIGHT: 004 -> 003-004 -> 003 -> empty
LEFT: 003 -> 003-004 -> 004 -> empty
I think that is good?!
My script is:
Var 1, name X_HDG, Link FSUIPC_INOUT, Offset $07CC, Length 2
{
// convert from fsuipc range to degrees:
L0 = DIV &X_HDG, 182
IF &HDG != L0
{
&HDG = L0
}
}
Var 2, name HDG
{
CALL &OutHDG
}
Var 3, name OutHDG, Link SUBRUTINE
{
// convert from degrees to fsuipc range:
L0 = &HDG * 182
IF &X_HDG != L0
{
&X_HDG = L0
}
}
Var 4, name RO_HDG, Link IOCARD_ENCODER, Input 3, Aceleration 4 Type 2
{
L0 = &RO_HDG // * -1 turning right should be plus
&HDG = ROTATE 0, 359, L0
}
Now in FS, when I turn the button to the right...
I see the heading bug move one degree to the right and immediately one to the left (for example 342 and instantly 341 again).
When I turn the encoder fast, it moves to the right, but very shaking and nog very well.
I changed the input number to 1 (that is my altitude encoder), the same happens, So I don't think it is a problem with the encoder.
Is there something wrong with my code?
Thanks again,
Steef
David helped me out with my problem showing heading on my sim-avionics.
Now I have the following problem:
I have a SIOC script to change my heading.
The goal of this script is only to change the heading bug on my virtual cockpit in FSX.
I have a CTS288 grey encoder from opencockpits, connected on the mastercard inputs 3 and 4 (and gnd off course)
When I look at the Controlador software, and turn the encoder I see:
RIGHT: 004 -> 003-004 -> 003 -> empty
LEFT: 003 -> 003-004 -> 004 -> empty
I think that is good?!
My script is:
Var 1, name X_HDG, Link FSUIPC_INOUT, Offset $07CC, Length 2
{
// convert from fsuipc range to degrees:
L0 = DIV &X_HDG, 182
IF &HDG != L0
{
&HDG = L0
}
}
Var 2, name HDG
{
CALL &OutHDG
}
Var 3, name OutHDG, Link SUBRUTINE
{
// convert from degrees to fsuipc range:
L0 = &HDG * 182
IF &X_HDG != L0
{
&X_HDG = L0
}
}
Var 4, name RO_HDG, Link IOCARD_ENCODER, Input 3, Aceleration 4 Type 2
{
L0 = &RO_HDG // * -1 turning right should be plus
&HDG = ROTATE 0, 359, L0
}
Now in FS, when I turn the button to the right...
I see the heading bug move one degree to the right and immediately one to the left (for example 342 and instantly 341 again).
When I turn the encoder fast, it moves to the right, but very shaking and nog very well.
I changed the input number to 1 (that is my altitude encoder), the same happens, So I don't think it is a problem with the encoder.
Is there something wrong with my code?
Thanks again,
Steef