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
JohanKotze
Posts: 52
I am using Event ID's on Inputs Tab for the encoders not Offsets as in Outputs for the 7 segment displays. IAS and Heading is working fine bit slow but working. The altitude on my diy mcp does not change, when turning the knob left or right nothing happens, stuck on 00000. But when I use FSX altitude knob with mouse scroll the altitude on my diy mcp altitude reading change but FSX = 00100, diy mcpaltitude reading 00099, fsx altitude = 00500, diy mcp altitude = 00499

MOBIFLIGHT SETTINGS
On Extras ->Settings->Mobiflight Modules->Mobiflight Mega->MCP ALT ENC (encoder added)->1 detent per cycle (00)
Arduino Pin = 38 (left turn)
Arduino Pin = 37 (right turn)

INPUT SETTINGS:
INPUT MODULE: MOBIFLIGHT MEGA
DEVICE: MCP ALT ENC
ON LEFT PRESET: ALTITUDE_BUG_SELECT
EVENT ID: 65880
PARA: 16384

ON RIGHT PRESET: ALTITUDE_BUG_SELECT
EVENT ID: 65879
PARA: 8192
[Last edited by JohanKotze, 2022-01-24 17:54]
2022-01-24 16:03
Avatar
JohanKotze
Posts: 52
I am using FSX with default B737. FSUIPC 4.977 and 2016 Control List
Preset: AP_ALT_VAR_DEC
Event ID: 65893
Para: 16384

Preset: AP_ALT_VAR_INC
Event ID: 65892
Para: 8192

If I turn the Altitude knob (encoder), 1 detent, on my DIY MPC the Altitude 7 segment display 8200, another 1 detent turn and the Altitude display 16400.
So I test the Altitude reading on the FSX MCP (autopilot) with mouse scroll. My DIY MCP Altitude 7 segment display respond correct, 100, 200, 300, 400 etc.
[Last edited by JohanKotze, 2022-01-25 08:22]
2022-01-24 20:10
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 5979
Supporter
Lots of Informations.... Lets split them UP

1. Slow Encoder.
Please Confirm your "MF Logging Mode" is Disabled. ( Done by a checkmark in Settings)
Logging is to find out problems while testing.... BUT its not build to run all the time. Specialy Encoder imputs get verry slow if the logging is active !

2. Paramter Setting
This is no issue.... But its wrong/unless !
A SET Event need a Parameter .... E.g. "SET QNH" will set Qnh to e.g. 1013 if you send THAT Value as Parameter.
All "Legacy" Events that are Toggles, Execute, INC , DEC and so on NOT need a Paramter. Simply send predefined "0" .
They will do always the same.
Your 16384 and 8192 pretty sure you see in the PMDG Guides. YES. for PMDG AddOns you need this !
For Stock Aircrafts this is wrong!

3. Split between INPUT and OUTPUT!
If you like to test your Encoder Inputs, then NOT check/confirm the usage by your Real 7Seg Display....
If there is a issue you not know if the problem is the Display or the Encoder !
Same Reverse..... If you test the Display.... Then not make the Input with your Encoder !

So go the easy way.... For testing your Display, make the Input with the Mouse in the Sim !
The display must show simply the Value of the Virtual Display.
If you like to test your encoders then observe the Virtual Display if your inputs work same way as the turning of the virtual Encoder will do.
NOT Care about that time what your 7Seg will show.... We confirm here the Input just by the virtual Display !

4. Rounding Problem.
In FSX and P3D the Altitude of Stock Aircrafts is done with a verry old and "bad" Offset.
iconQuote:

07D4 4Bytes Integer - Autopilot altitude value, as metres*65536



So we need a Formula like in the Preset ..... $*3.28084/65536 (*3.28084 to get feet from Meters... And /65536 to solve the FSUIPC Offset behavour)
Badly these Calculation can occure in e.g. 499,99993939 whatever 500 is needed.
So we need to tell Mobiflight it should ROUND the Result !
correct Syntax...... Round($*3.28084/65536,0)
Simply change the current Transform with that one.... then ALT is correct.


5. Wrong Inputs No response on Output and so on....
Confirm you use the correct Aircraft.
E.g. a AddOn like PMDG will not give it´s AP Alt on the same Offset like the Stock Cessna.
You need to know WHAT Aircraft you use and then you need to choose for the correct In- or Output Source !
Good Luck !
2022-01-25 11:10
Avatar
JohanKotze
Posts: 52
iconQuote:

So go the easy way.... For testing your Display, make the Input with the Mouse in the Sim !
The display must show simply the Value of the Virtual Display.


I did this and the 7 segment display respond correct,100, 200, 300 etc.

iconQuote:

If you like to test your encoders then observe the Virtual Display if your inputs work same way as the turning of the virtual Encoder will do.
NOT Care about that time what your 7Seg will show.... We confirm here the Input just by the virtual Display


This will try tonight and revert back here.

iconQuote:

So we need a Formula like in the Preset ..... $*3.28084/65536 (*3.28084 to get feet from Meters... And /65536 to solve the FSUIPC Offset behavour)
Badly these Calculation can occure in e.g. 499,99993939 whatever 500 is needed.
So we need to tell Mobiflight it should ROUND the Result !
correct Syntax...... Round($*3.28084/65536,0)
Simply change the current Transform with that one.... then ALT is correct.


I did this and seems to work fine, but will test again
2022-01-26 07:17
Avatar
JohanKotze
Posts: 52
iconQuote:

If you like to test your encoders then observe the Virtual Display if your inputs work same way as the turning of the virtual Encoder will do.
NOT Care about that time what your 7Seg will show.... We confirm here the Input just by the virtual Display


Ok, I tested the encoder with virtual display in fsx. The same problem. Turning encoder 1 detent to the right alt reading 8200, another detent alt reading 16400, another right detent turn alt reading 24600 etc.
Looks like every detent increases with 8200
2022-01-26 15:54
Avatar
JohanKotze
Posts: 52
I changed the Para to "0" now its working
2022-01-26 18:12
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 5979
Supporter
Strange.... Normaly the Parameter should be without effect for the legacy Events.

Whatever.... As i said. NOT use them. Always "0" for these kind of Events.
Good Luck !
2022-01-26 19:16
Avatar
JohanKotze
Posts: 52
All encoders is now working like it should. Now it is buttons with LEDs, switches coupled with LEDs

Thanks for all the help :)
2022-01-27 12:53
icon