Skip to content
Configuring the output

Configuring the output

Stepper motors are typically mapped to simulator variables that output numerical values. The following steps demonstrate how to use a 28BYJ-48 stepper motor with a ULN2003 driver to show the compass heading in Microsoft Flight Simulator 2020 and Microsoft Flight Simulator 2024.

Tip

The steps for using a stepper motor in an X-Plane project are similar. Use the X-Plane DataRef type when configuring the Sim Variable tab.

Add a new output config

Click the Add Output Config button in the main MobiFlight window to open the output configuration dialog.

Screenshot of the main window with the Add Output Config button highlighted.

Filter the output presets

On the Sim Variable tab, use the Filter Preset List dropdowns to filter by Microsoft, Generic, and Miscellaneous.

Screenshot of the sim variable tab in the output dialog filtered by Microsoft / Generic / Miscellaneous.

Select the magnetic compass preset

Use the Select Preset dropdown to select the MAGNETIC COMPASS preset.

Screenshot of the sim variable tab in the output dialog with the MAGNETIC COMPASS preset selected.

Select the board and device type for the output

On the Display tab, use the Module and Use type of dropdowns to select your connected board and the Display Module device type.

Screenshot of the display tab in the output dialog with a board and Display Module type selected.

Select the stepper motor to use for display

Use the Stepper dropdown to select the stepper motor that should display the output value.

Screenshot of the display tab in the output dialog with Stepper selected in the Stepper dropdown.

Specify the display scale

Since compass values are from 0–360, set the Display scale to 360 steps per revolution.

Screenshot of the display tab in the output dialog with display scale set to 360.

Tip

For smoother stepper motor movement, set the Display scale to 3600 and use a transform modifier to multiply the simulator value by 10 using the $*10 transform.

Set the stepper zero position

The zero position is the position MobiFlight will reset the stepper motor to when the connection to the simulator is lost.

To set the zero position, use the Move steps slider and Move button to rotate the stepper motor to the appropriate zero position, then click the Set Zero button to save the location.

Screenshot of the display tab in the output dialog with the Move Steps slider, Move button, and Set Zero button highlighted.

Close the dialog and name the config

Click the OK button to close the dialog, then double-click on the New Output Config name in the main window.

Screenshot of the main window with the New Output Config row text highlighted.

Type in a meaningful name for the new config, for example Compass, and press enter to apply the change.

Screenshot of the main window with Compass entered as a custom name.

Try out the event

Spawn an airplane in Microsoft Flight Simulator. Make sure the MobiFlight Run button is clicked in the toolbar. The stepper motor should move to match the compass heading in the simulator.