-
-
Notifications
You must be signed in to change notification settings - Fork 107
Examples Output LEDs
In this tutorial you connect a LED at the Arduino Mega. The LED is configured in such a way that it is in sync with the status of your parking brake. We therefore use the appropriate FSUIPC offset. The LED shines if the parking brake is set and turns off the moment you release the brake.
Sounds like fun? It is! First the electronical connection of the LED is explained. Then you'll learn step by step how to configure the MobiFlight Connector software.
Connect the LED directly at one of the pins of your Arduino Mega.
It is preferred to use a resistor within this connection. The voltage of the Mega's pin is 5V as stated in the data sheet. As you can see in the schematic view, the two pins at the bottom of the pins socket is marked as "GND" - pin 54 and 55. So we use one of these pins for our GND connection.
Take care that you properly connect the anode of the LED together with the resistor at pin 22 and the cathode with GND.
When you open MobiFlight Connector you'll see an overview of your current configuration. In this example we assume it is empty because nothing has been configured yet.
First you must open the settings dialog, because we want to configure the MobiFlight board. It has to know that at one of it's pins an LED is connected.
Let's go there by clicking Extras > Settings > MobiFlight Modules-Tab
On the left, choose the desired MobiFlight board in the tree view - there might be more than depending on how many boards are connected.
In the toolbar below, there are different buttons to perform different actions. To add a new device like a LED, click at Add Device > LED / Output.
Now a LED has been added to your MobiFlight module. You can see an icon that represents the LED.
On the right you define additional settings depending on the type of device that you add.
When using a LED there are only two options available
- Pin - refers to the pin's number as marked on the Arduino Board.
- Name - you can set a name here which is used later in the tool when you assign a function of your flight sim. Use a good name which makes it easy for you to find it again. In the example we stick with the default "Output"
There is one step left - we have to upload the new configuration to your board. Therefore click on the upload-button on the very left of the toolbar.
A message will show up that indicates whether the upload has been successful or not. In the positive case, now your MobiFlight will remember that on Pin 22 a LED is connnected - even if you restart it or power off.
Close the Settings dialog now by clicking on OK-button. You will return to the configuration overview - which still is empty.
Let's create the actual configuration for the parking brake state.
First, you assign a name to the new config entry by double-clicking on an empty row and typing it the name via the keyboard.
Click the ...-Button at the end of the row to enter the "Config Wizard"-dialog.
The "Config Wizard" shows up.
To make it easy, use one of the predefined presets from the preset list.
Look for "General - Parking Brake", select it and confirm with the "use"-Button next to the drop down field.
"Automagically" all settings regarding the FSUIPC offset are filled correctly.
Go to the "Display"-Tab
Choose your module from the list in the "display type" section
Choose "Pin" for the "Type" setting.
The settings will change accordingly.
Now from there select you your "Output"-Pin from the DropDown box labeled "Pin"
Push the Test-button to confirm that everything works as expected.
You LED should turn on.
If your LED does not turn on, verify that you have it connected properly and that polarity is correct, too. It's easy to confuse anode with cathode - I can tell ;)
If the LED shines, click the Stop-Button. The LED turns off.
Close the config wizard by clicking the OK-Button.
Start your flight sim, for example Microsoft Flight Simulator X.
Start your flight.
Wait a moment until MobiFlight Connector has established a connection with FSUIPC. You can see the status in the status bar at the bottom of MobiFlight Connector.
Once your flight is loaded and FSUIPC connection has been established, start the MobiFlight Connector.
Click on the start button from the toolbar (the green triangle)
The LED should immediately turn on because the default flight normally has the parking brake set.
Toggle the state of the parking brake - you'll see the LED turning on and off accordingly!
Hey, you got it right - the first experiment with the MobiFlight solution has been successful! Try out other configurations or head over to the next tutorial, where you connect a button to toggle the state of the parking brake.
Tell us in the Forum about your progress and your projects!
If you have trouble with this tutorial, start from the beginning again or ask for help on the forum also - the MobiFlight community will try to help you.
- MobiFlight Connector Installation
- Mobiflight Connector BETA version installation
- Modules
- MobiFlight Connector Files Structure
- MobiFlight Connector Uninstall
- Modules Reset to factory default
- Verifying the WASM module installation and locating the MSFS2020 community folder
- Verifying the WASM module installation and locating the MSFS2024 community folder
- Using a Winwing FCU with MobiFlight
- Using VKB controllers with MobiFlight
- Providing logs from MobiFlight
- MobiFlight Connector How does it work
- Mobiflight Connector Main Window
- Flash module with MobiFlight firmware
- Input and Output devices
- Joysticks
- Midi Boards
- Sim Variables (for Output)
- Input Actions
- Merging configuration files
- Disabling specific COM ports
- Examples Output LEDs
- Examples Input Switch
- Example 7 segment display
- Example Servo motor
- Controlling LEDs with an output shift register
- Adding lots of buttons with an input shift register
- Beginner's guide to input multiplexers
- Key Matrix with standard MobiFlight and Multiplexers
- Tutorial Easy Driver and x.27 or x.40 Stepper Motor
- Tutorial for Airbus VS display via 7-Segment LED Module
- Example Analog Input Potentiometer
- Baron G58 Tutorial Gear, Flaps, Mags, ELT Input Output Programming
- Using Mobiflight to control arduino-based 3rd party panels (RealSimGear GNS530)
- How to use a VNH2SP30 DC motor shield with MobiFlight
- Using 3D printer mainboards
- Playing sounds by sending keystrokes to AutoHotKey
- Using the selector knob on a Honeycomb Bravo
- Using an adjustable 12 position switch as a GA starter
- Brightness of LCD displays with I2C
- Using three-position switches
- Transponder with one Rotary
- Workflow for Creating Flight Simulation Panels ‐ Part 1
- MSFS2020 RPN Tips and Tricks
- MSFS2020 Using the Custom Input Code Box
- MSFS2020 Install WASM module and Event List
- MSFS2020 How to Create and Use User Defined Lvars
- MSFS2020 How to Create a Blinking LED configuration
- MSFS2020 User Defined WASM Module Events Best Practices
- MSFS2020 Developer Mode, Model Behavior dialog and Console window
- MSFS2020 PMDG 737‐700 List of Events that require use of FSUIPC7
- MSFS2020 PMDG 737‐700 Calibrate throttle idle and reverse thrust using interpolation (Valkyrie)
- MSFS2020 PMDG 737-700 Chrono unit functions implemented in Mobiflight
- Configuring PMDG 737 Parking Brake Lever Auto-Release with a Servo in Mobiflight
- Using encoder to drive a value back and forth within a given range
- Adding a custom board to MobiFlight
- User guide - Community Board and Custom Devices
- Developing your own custom devices/boards