PMDG 737 and OpenCockpits MCP
OK,
so just got my MCP panel from opencockpits and have started my SIOC for it, I was wondering if anyone was having issues with the speed of the rotaries due to keypresses having to be sent... So i started to have a play and came up with this.
Its so much better now, you can get quite nice fast changes with a fast spin, but keep the accuracy when slow.. enjoy :)
BTW it needs cleaning up so sorry about the naming etc :)
Code:
var 9991, name temphdg, value 0
var 9992, name LastHDGRot, value 0
var 8100, name Plus, Link SUBRUTINE
{
&temphdg = &plus
if &temphdg = &LastHDGRot
{
&temphdg = 0
}
if &plus > 0
{
CALL &HDGplus
}
}
var 8101, name Minus, Link SUBRUTINE
{
&temphdg = &Minus
if &temphdg = &LastHDGRot
{
&temphdg = 0
}
if &minus > 0
{
CALL &HDGminus
}
}
Var 8001, name HDGplus, Link SUBRUTINE
{
&KEYS = 47
&KEYS = 0
}
Var 8002, name HDGminus, Link SUBRUTINE
{
&KEYS = 48
&KEYS = 0
}
Var 9082, name HDGrot, Link IOCARD_ENCODER, Input 6, Aceleration 8, Type 2
{
&CRSRdisplay = &HDGrot
if &HDGrot > 0
{
IF &temphdg = 0
{
&LastHDGRot = &HDGrot
&Plus = 0
&Plus = TIMER &HDGrot 1 1
}
}
else
{
IF &temphdg = 0
{
L1 = &HDGrot * -1
&LastHDGRot = L1
&Minus = 0
&Minus = TIMER L1 1 1
}
}
IF &HDGled = 0
{
L0 = &HDGrot * -1
&MEMHDG = ROTATE 0 ,359 ,L0
}
CALL &HDGaff
}