MobiFlight Community Support

Welcome to the forum for MobiFlight! Feel free to reach out to the community in case you have questions, issues or just want to share great ideas or details about your latest home cockpit project.

You like MobiFlight? Donate via PayPal and support the MobiFlight development. Thanks! 

icon
Avatar
hrings
Posts: 62
How shall a rotary switch be programmed.
F.inst starter switch on a 737 with 4 position .
I have tried with both event ID and PMDG event id but I am unable to find out what parameter to use at the different positions both on press and on release.
I have also tried with FSUIPC offset 74fc and as said 0 for start 1 for off 2 for cont and 3 for flight on press and nothing for release I have used pin 14 to 17 on arduino 2560.
No response on the switch
Any tips
HenninR
2020-05-02 13:53
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3522
Supporter
Lots of issues.... Lets talk about the basics.

1. Correct Input Typ:
For PMDG internal stuff always use PMDG Event and nothing else.... No PMDG Offset.... No FSUIPC Offset and also no FSUIPC EventID.

2. Correct Programming of a Rotaryswitch
Each used Position got a Pin..... each must be wired to a single pin on the Mega..... Each Pin on Mega get defined as a BUTTON Device.
For Rotarys we NOT use "on release".... Only "on Press" is needed and correct here.
For each position (Button) we define the parameter that should be used.... Whatever all Buttons use the same Event in that case.
NOTE: For Multi Position Switches ( non momentary) we use Parameters like "0,1,2,3,4 and so on" INSTEAD of Mouseaction Parameters !

3. You quote wrong Offset
Not important cause you already need the EventID.... BUT the Offset is not 74FC.... it would be 64FC

4. How to find correct Parameters.
Simply check the OUTPUT Mapping PDF and search the same Switch. Every Switch also got a Output Offset. As i said we can not WRITE it BUT we can see there what parameters are used.
Your example:
iconQuote:

64FC 2 BYTE x 2 ENG_StartSelector[2] 0: GRD 1: OFF 2: CONT 3: FLT


The same Values you need to SET the Commands via EventID

5. Finaly procedure:
Use Event 69751 for LEFT Switch and 69753 for RIGHT Switch.... Parameter as explaned above.... Only ON PRESS !
Good Luck !
2020-05-02 14:56
Avatar
hrings
Posts: 62
Is it then that I have used offset that makes it wrong.
I wrote wrong in the message above, I have used for left 64FC.
My programming are as follows:

For the left starter:
all 4 as buttons Arduino pin no 14,15,16 and 17
On Press
FSUIPC offset
GND 64FC Value type: Int 1 Set value: 0
Off 64FC " " 1
cont 64FC " " 2
Flt 64FC " " 3

On Release
none
HenningR
2020-05-02 15:58
Avatar
StephanHo
Moderator
From: EDDG, Germany
Posts: 1525
Supporter
Hi Henning,

For engine 1 you did it right:

64FC 1 Byte int
GRD=0
OFF=1
CONT=2
FLT=3

For engine 2 take offset 64FE 1 Byte int and the same parameters
Release is not required.
Grüße,
Stephan
2020-05-02 16:40
Avatar
hrings
Posts: 62
Yes I thougt so but it does not work as it should
2020-05-02 20:07
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3522
Supporter
iconhrings:

Yes I thougt so but it does not work as it should



READ what i said !

iconpizman82:



1. Correct Input Typ:
For PMDG internal stuff always use PMDG Event and nothing else.... .... No PMDG Offset.... No FSUIPC Offset and also no FSUIPC EventID.



The Offset 64FC is a OUTPUT.... We can use it for preconditions or to readout in what position the virtual switch is at the moment BUT it is not possible to write any PMDG Offset !
Good Luck !
2020-05-02 20:21
Avatar
hrings
Posts: 62
Thanks a lot.
main problem was that I had taken the direction of the rotary switch the wrong way so pin 14 was pin 18 and so on. after that worked like a dream.
Understand that when it comes to switches I shall always use pmdg event id and offset only for outputs.
HenningR
2020-05-02 21:48
icon