Input and Output devices - MobiFlight/MobiFlight-Connector GitHub Wiki
The following device types are currently supported by the MobiFlight firmware:
Input devices
Input devices are all kinds of devices that allow a user to trigger an input event through a hardware device.
Buttons and Switches
You can use any kind of buttons and switches. There are many forms and shapes:
- Push buttons
- Tactile switches
- Micro switches
- Toggle switches
- Kill switches
Switches comes as momentary buttons (push button), latch buttons (they stay pressed) or switches that have a handle that you can flip, where the position also can be momentary (ON), or stays ON. There are typical configurations for such switches:
- ON-OFF - These switches require one input pin. The handle can be moved in ON position or in OFF position providing a low or high signal to the MobiFlight Board.
- ON-ON - These switches require two input pins. The handle can be set to two different positions (on and off) but both have their own high signal.
- (ON)-OFF - Switch requires one input pin. On position is only momentarily as long as user holds the switch in the ON-position. On releasing the handle, the switch will go back to the OFF position.
- ON-OFF-ON - These switches require two input pins. The handle can be set to three different positions ("on" on one side, off in the middle, "on" to other side).
- (ON)-OFF-ON -These switches require two input pins. One On position is momentarily only as long as the user holds the switch. On release the switch snaps back to the OFF (middle) position. The opposite ON-position is a permanent position. This switch is used, e.g. for APU switch in the B737.
- (ON)-OFF-(ON) -These switches require two input pins. Both "On" positions are momentarily only as long as the user holds the switch. On release the switch snaps back to the OFF (middle) position. This switch can be used as trim switch or flaps switch.
Encoders
Encoders are important for building cockpits because many avionics use them.
Device Settings
Pin Settings
- Left Pin
- Right Pin
Type
- 1 detent per cycle (00)
- 1 detent per cycle (11)
- 2 detents per cycle (00, 11)
- 2 detents per cycle (01, 10)
- 4 detents per cycle
Name
- The name of the device (max 16 characters)
Events
Encoders support the following events
- onLeft - triggered on every detent when encoders turns left
- onLeftFast - triggered when encoders is turned left fast (multiple detents per second)
- onRight - triggered on every detent when encoders turns right
- onRightFast - triggered when encoders is turned right fast (multiple detents per second)
Devices
- Single Shaft Encoders
- Dual Shaft Encoders
Analog inputs
Analog input devices can be connected to the analog pins of your MobiFlight Board. An analog input device will vary the voltage between 0-5V at the respective pin which will translated into a value between 0 and 1024.
Device Settings
Pin Settings
- Pin - Only allows to choose from the analog pins that are available.
Sensitivity
- Can be set from high (1) to low (20) - the value indicates how much the value has to change at the analog input to actually trigger an input event. The smaller the value, the more events are triggered.
Name
- The name of the device (max 16 characters)
Events
Analog input devices provide the following events
- onChange - is triggered when the input value changes (depending on sensitivity setting) and you can reference the current value by using the @-Symbol.
Devices
- Potentiometers are the typical device that you can connect via an analog input.
Input Shift Registers
Input Shift Registers allow to increase the number of buttons. Read more information about how to configure and use an input shift register with MobiFlight
Device Settings
Pin Settings
- Latch
- Clock
- Data
- # of 8 bit registers
Name
- The name of the device (max 16 characters)
Events
Input Shift Registers support the the same events like a button.
Devices
- SPI input shift register, e.g. 74HC165
Input Multiplexer
Multiplexer allow to increase the number of buttons.
Device Settings
Pin Settings
- S0, S1, S2, S3 - these are the channel select pins. You define these pins only once per MobiFlight board.
- Data - the data pin. Every additional multiplexer defines their own data pin.
- Type - select whether you have a 8bit or 16bit multiplexer, default is 16bit
Name
- The name of the device (max 16 characters)
Events
Input Multiplexer support the the same events like a button.
Devices
- 74HC4067 (16-bit multiplexer)
Output devices
LED / Output
The "LED / Output" is a simple one pin output that can be either set to "On" (5V) or "Off" (0V). This allows to drive LEDs or relais, transistors, etc. Depending on your Arduino board, some pins support PWM signals. In this case, you can control the PWM signal through values from 0-255.
Device Settings
Pin Settings
- Pin - define the pin for the output, if pin supports PWM, then (PWM) will be displayed.
Name
- The name of the device (max 16 characters)
Devices
- LEDs
- Relais, optocoupler, etc.
7 segment modules
7-Segment modules are used frequently in plane avionics like radios or autopilots. MobiFlight supports MAX7219 and TM1637 drivers.
MAX7219 drivers
MAX7219 can drive 8 digits. They require three pins. You can daisy-chain MAX7219 chips and compatible modules. Up to 8 modules or chips can be in one such chain.
TM1637 drivers
TM1637 drivers can drive 6 digits; common modules on the market have four or six digits. They require two pins. They cannot be daisy chained.
Device Settings (MAX7219)
Device Settings (TM1637)
Type Select what kind of chip the 7-segment device is using. You can choose from:
- MAX72xx - all MAX7219 or MAX7222 based displays
- TM1637 4Digit - TM1637 based displays with four (4) digits
- TM1637 6Digit - TM1637 based displays with six (6) digits
Pin Settings
- DIN - the SPI data in pin
- CS - the SPI chip select pin (only MAX7219)
- CLK - the SPI clock pin
- NUM - defines the number of modules that are daisy chained, this is needed for correct initialization and display.
Global intensity Adjust the global intensity and affect the default brigthness of the module on start of MobiFlight. You can later adjust the brightness as part of your output config.
Name
- The name of the device (max 16 characters)
Devices
- MAX7219 chips
- MAX7219 LED modules
- TM1637 4 and 6 digit chips and modules
Servos motors
Servo motors typically have a range of about 180 degrees and can be used for classic gauges and indicators.
Device Settings
Pin Settings
- DIN - the servo's DIN line
Name
- The name of the device (max 16 characters)
Devices
- Common servo motors, e.g. SG90
Stepper motors
Servo motors typically have a range of about 180 degrees and can be used for classic gauges and indicators.
Device Settings
Pin Settings
- Pin1 - pin 1 for coil 1
- Pin2 - pin 1 for coil 2
- Pin3 - pin 2 for coil 1
- Pin4 - pin 2 for coil 2
The commonly available 28ybj stepper motors and the ULN2003 breakout boards have their pin labled the same way as the MobiFlight UI. Other stepper motors might have different order or labeling.
Auto Zero Input Stepper motors can be auto-homed by using a switch that closes when the "0"-position of the stepper is reached. This is optional. Remove the tick from the checkbox "None" and select a free pin instead where your switch is connected to.
Name
- The name of the device (max 16 characters)
Devices
- Common stepper motors, e.g. 28ybj
LCD displays
LCD Displays are very flexible and versatile displays that can display many different values at the same time. MobiFlight supports LCD Displays that come with a I2C connector. These connectors have to be connected to the I2C pins of your Arduino board. Individual LCDs must have their individual I2C addresses.
Device Settings
Display Settings
- Address - the I2C address of your lcd display. The dropdown contains the values that are configurable.
- Columns - the number of columns (characters) of your LCD display
- Lines - the number of lines (rows) of your LCD display
Name
- The name of the device (max 16 characters)
Devices
- Common LCD displays with I2C module, e.g. LCD 1602 (2 lines, 16 characters), LCD 2004 (4 lines, 20 characters)
Output Shift Registers
Output Shift Registers allow to increase the number of simple outputs. Read more information about how to configure and use an output shift register with MobiFlight
Device Settings
Pin Settings
- Latch
- Clock
- Data
- # of 8 bit registers
Name
- The name of the device (max 16 characters)
Devices
- SPI output shift register, e.g. 74HC595
Custom Devices
Custom devices are a new type of supported device which allows the MobiFlight Community to extend the capabilities of the MobiFlight boards.
Adding and removing custom devices
You can add and remove custom devices in the same way you do it for Input devices or Output devices
Installing custom devices
A custom device requires a specific firmware and a specific config file for MobiFlight which has to be installed into the devices
-folder.
The process currently is very manual since this a very new and experimental feature. Please contact the provider of the custom device for installation instructions.