Dave,
I had an error in my last post..should have read:
JimCode:Var 0138, Link IOCARD_SW, Input 13, Type P // Push Button for Transponder Mode
{
V0135 = CHANGEBITN 0 V0138
}
Printable View
Dave,
I had an error in my last post..should have read:
JimCode:Var 0138, Link IOCARD_SW, Input 13, Type P // Push Button for Transponder Mode
{
V0135 = CHANGEBITN 0 V0138
}
Jim,
Thanks for hanging in there with me. To the best of my knowledge the SB Offset isn't broke down further into bits. It is a value only (ie. 0 or 1)
However I am happy to report success. I went back to my original idea of using a rotary switch after finding a script at the OC forum. The script was much more complicated than I needed for a wide range of radio functions. Buried within it was the transponder and I was able to scrounge some code from the overall script. Modified it slightly and it worked. Rotary switch starts in off position and led is unlit ; switch to Standby position and led remains unlit ; switch to active (Mode C) and led lights up. Switching back to standby or off and led turns off.
FYI here is the piece of code that did the trick:
Cheers, DaveCode:Var 0304, Link IOCARD_SW, Input 13 // XPNDR Mode STBY
{
IF V0304 = 1
{
V0399 = 1
}
}
Var 0305, Link IOCARD_SW, Input 14 // XPNDR Mode Normal
{
IF V0305 = 1
{
V0399 = 0
}
}
Var 0399, Link FSUIPC_OUT, Offset $7B91, Length 1 // Squawkbox XPNDR Mode
{
CALL V0139
}
Var 0139, Link SUBRUTINE // state of transponder to set led
{
IF v0399 = 0
{
&XPONDER_LED = 1
}
ELSE
{
&XPONDER_LED = 0
}
}
Var 0140, name XPONDER_LED, Link IOCARD_OUT Output 23 // led to indicate standby or Mode C