COM/NAV with single encoder[SOLVED]

This is a new forum for the OC4BAv4.
Post Reply
nolatron
Posts: 20
Joined: Sun Apr 29, 2018 12:49 am

COM/NAV with single encoder[SOLVED]

Post by nolatron »

On my COM and NAV panels I only have single rotary encoders installed in it.

Is it possible to have the encode's pushbutton toggle the encoder between adjusting the numbers before the decimal and after it?
mvr1918
Site Admin
Posts: 1709
Joined: Thu Aug 30, 2012 3:35 pm

Re: COM/NAV with single encoder

Post by mvr1918 »

It should work OK, but you need to make some changes to the COM/NAV script part. If you take a look at the script part for the EFIS you will see how I have implemented double functions for some knobs.
nolatron
Posts: 20
Joined: Sun Apr 29, 2018 12:49 am

Re: COM/NAV with single encoder

Post by nolatron »

Thanks, was able to get it working.
mvr1918
Site Admin
Posts: 1709
Joined: Thu Aug 30, 2012 3:35 pm

Re: COM/NAV with single encoder

Post by mvr1918 »

To find the COM/NAV script code working with single rotary encoders,
see Shaun's mod at his site:

http://www.tronaviation.com
nolatron
Posts: 20
Joined: Sun Apr 29, 2018 12:49 am

Re: COM/NAV with single encoder[SOLVED]

Post by nolatron »

Doh! I meant to post that here so it's archived here as well.

Here’s the changes I made for COM1 and NAV1 radio panels to work with a single rotary encoder. You’ll need to adjust the Device and Input numbers for your hardware, and possibly the rotation value, adding a negative (-) or not, depending on your hardware setup.

Find this block of code for the COM1 panel:

Var 0502, name ROT_COM1_SW, Link IOCARD_ENCODER, Device 31, Input 57, Aceleration 1, Type 2
{
L0 = &ROT_COM1_SW * 1 // change turning direction
&ST_COM1High = ROTATE 18 ,36 ,L0
CALL &Com1ToNGX
}

Var 0503, name ROT_COM1_SF, Link IOCARD_ENCODER, Device 8, Input 4, Aceleration 1, Type 2
{
L0 = &ROT_COM1_SF * 25 // instead of acceleration that doesn't wor
&ST_COM1Low = ROTATE 0 ,999 ,L0
CALL &Com1ToNGX
}

and replace with the following

Var 8600, name COM_SWITCH, Link IOCARD_SW, Device 31, Input 62 Type P // in the shaft

Var 8601, name ROT_COM1_SW, Link IOCARD_ENCODER, Device 31, Input 57, Aceleration 1, Type 2
{
L0 = v8601 // * -1 make sure turning right increments
IF v8600 = 0
{
L0 = &ROT_COM1_SW * 1 // change turning direction
&ST_COM1High = ROTATE 18 ,36 ,L0
CALL &Com1ToNGX
}
ELSE
{
L0 = &ROT_COM1_SW * 25 // instead of acceleration that doesn't wor
&ST_COM1Low = ROTATE 0 ,999 ,L0
CALL &Com1ToNGX
}
}

======

Find this block of code for the NAV1 panel:

Var 0524, name ROT_NAV1_SW, Link IOCARD_ENCODER, Device 31, Input 55, Aceleration 1, Type 2
{
L0 = &ROT_NAV1_SW * -1 // change turning direction
&ST_NAV1High = ROTATE 8 ,17 ,L0
CALL &Nav1ToNGX
}

Var 0525, name ROT_NAV1_SF, Link IOCARD_ENCODER, Device 9, Input 4, Aceleration 1, Type 2
{
L0 = &ROT_NAV1_SF * -5 // instead of acceleration that doesn't wor
&ST_NAV1Low = ROTATE 0 ,99 ,L0
CALL &Nav1ToNGX
}

and replace with the following

Var 8602, name NAV_SWITCH, Link IOCARD_SW, Device 31, Input 61 Type P // in the shaft

Var 8603, name ROT_NAV1_SW, Link IOCARD_ENCODER, Device 31, Input 55, Aceleration 1, Type 2
{
L0 = v8603 // * -1 make sure turning right increments
IF v8602 = 0
{
L0 = &ROT_NAV1_SW * -1 // change turning direction
&ST_NAV1High = ROTATE 8 ,17 ,L0
CALL &Nav1ToNGX
}
ELSE
{
L0 = &ROT_NAV1_SW * -5 // instead of acceleration that doesn't wor
&ST_NAV1Low = ROTATE 0 ,99 ,L0
CALL &Nav1ToNGX
}
}

Here's a video showing it in action:
https://www.youtube.com/watch?v=jpovN2mLImQ
mvr1918
Site Admin
Posts: 1709
Joined: Thu Aug 30, 2012 3:35 pm

Re: COM/NAV with single encoder[SOLVED]

Post by mvr1918 »

Thanks for sharing here as well.
Post Reply