Page 1 of 2

Help with rotary switch

Posted: 23 Jun 2019, 23:47
by chrishoppy
I have a single push button rotary switch on my goflight mcp which controls the heading. In fsx it controlled bank angle too, this was done by pushing the rotary switch and turning at the same time. I am now on xplane and I have no idea how to do this. I want to make the heading stop turning when I push the rotary in and turn just the bank angle.
Thanks

Re: Help with rotary switch

Posted: 23 Jun 2019, 23:58
by Oz Flyer
If the push button and the rotary switch both show up in SPAD then all you need to do is add 2 events to the rotary switch.
One with an Execute action push button = 0
and the other with an Execute action push button = 1

Re: Help with rotary switch

Posted: 24 Jun 2019, 11:56
by chrishoppy
not entirely sure how i do that in the programme. currently my heading rotary switch is asigned turn clockwise for increase heading and counter clockwise for decrease heading. i want to make it so when i push the rotary switch in and turn either clockwise or counter clockwise it disables turning the heading but enables the bank angle to be turned.

attached file is to show what options i have at the side corrisponding with the heading rotary switch.

thanks

Re: Help with rotary switch

Posted: 24 Jun 2019, 12:21
by krono
Hi
If you are using a rotary encoder switch then this is a fairly easy situation.I use these on my gyro compass AP heading. Anti clockwise to decrement the value and clockwise to increment the value and the central push switch to change the value of the incremented value or in your case the value type.

<BaseEvent xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" BoundTo="BUTTON_45" xmlns="http://www.fsgs.com/SPAD">
<EventDefinitions>
<EventDefinition Trigger="PRESS">
<EventConditions>
<EventCondition ConditionComparator="Equals" ConditionTargetValue="0" ConditionValueSource="LOCAL:GYRO COMPASS HEADING BUTTON" />
</EventConditions>
<EventActions>
<EventActionChangeValue TargetDataDefinition="FSUIPC:0000:2B00" Value="1" ValueOperation="Decrement" />
</EventActions>
</EventDefinition>
<EventDefinition Trigger="PRESS">
<EventConditions>
<EventCondition ConditionComparator="Equals" ConditionTargetValue="1" ConditionValueSource="LOCAL:GYRO COMPASS HEADING BUTTON" />
</EventConditions>
<EventActions>
<EventActionChangeValue TargetDataDefinition="FSUIPC:0000:2B00" Value="10" ValueOperation="Decrement">
<Options>
<Option Key="HASMINMAX" Value="True" />
<Option Key="VALUEMAX" Value="360" />
<Option Key="ROLLOVER" Value="True" />
</Options>
</EventActionChangeValue>
</EventActions>
</EventDefinition>
</EventDefinitions>
</BaseEvent>

Above is the increment and decrement section. Below is the part for the central push switch. To do this make a new local value of your own that shows when the switch is pushed.

<BaseEvent xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" BoundTo="BUTTON_31" xmlns="http://www.fsgs.com/SPAD">
<EventDefinitions>
<EventDefinition Trigger="PRESS">
<EventActions>
<EventActionChangeValue TargetDataDefinition="LOCAL:GYRO COMPASS HEADING BUTTON" Value="1" ValueOperation="Increment">
<Options>
<Option Key="HASMINMAX" Value="True" />
<Option Key="VALUEMAX" Value="1" />
<Option Key="ROLLOVER" Value="True" />
</Options>
</EventActionChangeValue>
</EventActions>
</EventDefinition>
</EventDefinitions>
</BaseEvent>

The rotary encoder switch is connected to a Leo Bodnar 64 button board
http://www.leobodnar.com/shop/index.php ... cts_id=300

I hope this helps you in some way
Ken

Re: Help with rotary switch

Posted: 24 Jun 2019, 14:50
by chrishoppy
Stuff racking my brains. So far I have managed to make the push button toggle heading on and off and bank angle on and off but I have to keep pushing the button instead of push to disable heading and release to enable heading increments. Also not sure how to make my own value for the push button. Is there a manual that shows everything for spad?

Re: Help with rotary switch

Posted: 24 Jun 2019, 23:55
by Oz Flyer
chrishoppy,
What time zone (GMT +/- Hours) are you in and do you have discord with headset?

Re: Help with rotary switch

Posted: 25 Jun 2019, 00:06
by Oz Flyer
First thing I would do is get the rotary switch working on one or the other (Heading or Bank angle) once that is done we can add the push button to it.
I would start with what you want when button is pushed in.

Re: Help with rotary switch

Posted: 25 Jun 2019, 09:37
by chrishoppy
I have the rotary switch programmed for heading turning clockwise and anti clockwise. Also the bank angle is programmed for clockwise and anti clockwise. The main bit I'm stuck on is stopping heading turning whilst I push and turn for bank angle and when released stop the bank angle turning but allow heading to turn. I'm unsure what all the events do I.e shortmode longmode pressed short button release as there is no manual to read about these events.

Re: Help with rotary switch

Posted: 25 Jun 2019, 14:48
by Oz Flyer
chrishoppy,
What time zone (GMT +/- Hours) are you in and do you have discord with headset?

Re: Help with rotary switch

Posted: 25 Jun 2019, 15:14
by Oz Flyer
Ok so you should have 4 Event's one for each function.
open the Data Monitor
click add data
on the left click "LOCAL" then "Devices" then the "device name"
then find the button listed on the right and select it.
the data monitor should now tell you the value of that button and when you push the button it will change the value record the 2 values.

now edit one of the events
Next to the Execute Action(s) (top box) click Add Condition
click Select Data
on the left click "LOCAL" then "Devices" then the "device name"
then find the button listed on the right and select it.
Set Comparator to "Equals"
in the value box put the value for the button when in the state (Pushed/unpushed) that it needs to be.
repeat this last section for the other 3 events

You should end up with
1 * C.W. pushed
1 * C.W. unpushed
1 * C.C.W. pushed
1 * C.C.W. unpushed

Let me know how you go.