iwik
06-27-2011, 03:00 PM
Hi All,
Im battling again, it seems to be a never ending battle for me. Read all docs, been to Nico
site but my code dont do what i want. The simple stuff is ok but when i have to do
anything slightly diff all goes wrong. It seems to me this sioc is not what it appears.
Heres my problem.
Im driving an Analogue meter from the Servo card via a PWM to Dc converter. AS the
first 25% of the scale is non linear i have to add an offset for this first 25%.
Here is my Code:
Var 1002,name Fuel Link FSUIPC_IN,Offset $0b7c,Length 4
{
L0 = v1002 / 8388608
L2 = L0 * 100
IF L2 < 25
{
CALL V100
}
ELSE
V1000 = L0 * 1023
}
VAR 100,Link SUBRUTINE
{
L1 = L0 * 1023
V1000 = L1 + 70
}
Var 1000,Link USB_SERVOS,Output 2,Posl 0,Posc 512,Posr 1023,Type 2
If i select 20% fuel in FSX then it just carries out the statement after ELSE.
I thought that after an IF statement(L2 < 25) the Code following in the Curly Brackets
would be executed. In my case its not, ive tried everything but no success.
Apparently this if statement is not what it appears.
Can someone please help.
Thanks
Les
Im battling again, it seems to be a never ending battle for me. Read all docs, been to Nico
site but my code dont do what i want. The simple stuff is ok but when i have to do
anything slightly diff all goes wrong. It seems to me this sioc is not what it appears.
Heres my problem.
Im driving an Analogue meter from the Servo card via a PWM to Dc converter. AS the
first 25% of the scale is non linear i have to add an offset for this first 25%.
Here is my Code:
Var 1002,name Fuel Link FSUIPC_IN,Offset $0b7c,Length 4
{
L0 = v1002 / 8388608
L2 = L0 * 100
IF L2 < 25
{
CALL V100
}
ELSE
V1000 = L0 * 1023
}
VAR 100,Link SUBRUTINE
{
L1 = L0 * 1023
V1000 = L1 + 70
}
Var 1000,Link USB_SERVOS,Output 2,Posl 0,Posc 512,Posr 1023,Type 2
If i select 20% fuel in FSX then it just carries out the statement after ELSE.
I thought that after an IF statement(L2 < 25) the Code following in the Curly Brackets
would be executed. In my case its not, ive tried everything but no success.
Apparently this if statement is not what it appears.
Can someone please help.
Thanks
Les