Introduction
These are the docs for the Flightconnector.
Supported simulators
- Microsoft Flight Simulator 2020
- (will work on compatibility ASAP) Microsoft Flight Simulator 2024
How does the connector work
The connector uses Serial communication to communicate with your peripherals. It listens for data transmitted by your devices (we call them inputs) and at the same time it can send data to your devices (we call these outputs). ID's are used to match inputs and outputs to the correct simulation variables.
Input flow
You'll find a list of all available inputs in the inputs chapter.
Output flow
You'll find a list of all available outputs in the outputs chapter.
Installation
Connector
The connector can be installed using the latest installer. During startup the connector will automatically check for updates on Github. A pop-up will appear if a new version is available.
WASM
The WASM module unlocks more simulation variables with which to interact. The WASM chapter provides a full explanation. You're able to install the module by copying the entire wasm_module into the MFS2020 community package folder.
If you want to ensure the module is properly installed, you're able to follow these steps:
- Start MFS2020
- Open the option menu
- Enable developer mode
- Open the debug menu
- Open the console
- Search for BitsAndDroids
If the search results show messages that the module was initialized, the module will be loaded properly.
Install from the connector
You’re able to install the WASM module using the installer in the connector.
- Click on settings from the menubar
- Select install WASM
- Click on the “select directory” button
- Search for the MFS2020 community folder
- Click “Select folder”
- Click the confirm button
To check if the installation succeeded, you can open the community folder. If the installation succeeded, there should be a folder called BitsAndDroidsModule.
Your first flight with the Connector
Let's setup the connector and take it for a spin. The simplest action to perform is to connect a button to the connector and see if it works. We will use the simulator to see if the button press is registered. So, let's get started.
Make sure you have the connector installed. If not, follow the instructions in the Installation section.
Open the connector and you will see the following screen: //TODO add image
On this screen you're able to start/stop the connector and add/remove devices. For every peripheral you want to connect to the connector, you need to add a device. In this example we will add a single device to the connector.
To keep things simple, we will use a button to connect to the connector. The button will be used to trigger the parking brake in the simulator. The connector will send the signal to the simulator when the button is pressed. For this example we will be using an Arduino Uno but any other microcontroller will work as well. The code for the Arduino Uno can be found here. // THIS ARTICLE IS INCOMPLETE AND WILL BE EXPANDED
Bundles
A bundle is a group of outputs. For example, you can have a bundle for all outputs that are used for a specific controller. This makes it possible to send the correct data to the controller. You can also use these bundles to save multiple presets.
Inputs
Event | Input Type | Input ID |
---|---|---|
SET_THROTTLES | Action | 199 |
SET_MIXTURES | Action | 115 |
SET_PROPS | Action | 198 |
SET_BRAKES | Action | 902 |
SET_YOKE | Action | 103 |
AXIS_THROTTLE1_SET | Axis | 203 |
AXIS_THROTTLE2_SET | Axis | 204 |
AXIS_THROTTLE3_SET | Axis | 205 |
AXIS_THROTTLE4_SET | Axis | 206 |
THROTTLE1_AXIS_SET_EX1 | Axis | 207 |
THROTTLE2_AXIS_SET_EX1 | Axis | 208 |
THROTTLE3_AXIS_SET_EX1 | Axis | 209 |
THROTTLE4_AXIS_SET_EX1 | Axis | 210 |
AXIS_MIXTURE1_SET | Axis | 211 |
AXIS_MIXTURE2_SET | Axis | 212 |
AXIS_MIXTURE3_SET | Axis | 213 |
AXIS_MIXTURE4_SET | Axis | 214 |
AXIS_PROPELLER1_SET | Axis | 215 |
AXIS_PROPELLER2_SET | Axis | 216 |
AXIS_PROPELLER3_SET | Axis | 217 |
AXIS_PROPELLER4_SET | Axis | 218 |
AXIS_FLAPS_SET | Axis | 421 |
AXIS_RUDDER_SET | Axis | 901 |
AXIS_LEFT_BRAKE_SET | Axis | 221 |
AXIS_RIGHT_BRAKE_SET | Axis | 222 |
AXIS_ELEVATOR_SET | Axis | 223 |
AXIS_AILERONS_SET | Axis | 224 |
ELEVATOR_TRIM_SET | Axis | 900 |
TOGGLE_MASTER_IGNITION_SWITCH | Trigger | 101 |
COM_RADIO_SET | SetValueCom | 100 |
COM2_RADIO_SET | SetValueCom | 102 |
XPNDR_IDENT_OFF | Trigger | 103 |
XPNDR_IDENT_ON | Trigger | 104 |
XPNDR_IDENT_TOGGLE | Trigger | 105 |
XPNDR_SET | SetValueCom | 106 |
COM_RADIO_WHOLE_DEC | Trigger | 111 |
COM_RADIO_WHOLE_INC | Trigger | 112 |
COM2_RADIO_WHOLE_DEC | Trigger | 113 |
COM2_RADIO_WHOLE_INC | Trigger | 114 |
COM1_RADIO_SWAP | Trigger | 116 |
COM2_RADIO_SWAP | Trigger | 117 |
NAV1_RADIO_SWAP | Trigger | 118 |
NAV2_RADIO_SWAP | Trigger | 119 |
COM_RADIO_FRACT_DEC | Trigger | 124 |
COM_RADIO_FRACT_INC | Trigger | 125 |
COM_STBY_RADIO_SET | SetValueCom | 260 |
COM2_RADIO_FRACT_DEC | Trigger | 120 |
COM2_RADIO_FRACT_INC | Trigger | 121 |
COM_RADIO_FRACT_DEC_CARRY | Trigger | 126 |
COM_RADIO_FRACT_INC_CARRY | Trigger | 127 |
COM2_RADIO_FRACT_DEC_CARRY | Trigger | 122 |
COM2_RADIO_FRACT_INC_CARRY | Trigger | 123 |
COM2_STBY_RADIO_SET | SetValueCom | 261 |
NAV1_RADIO_FRACT_INC | Trigger | 128 |
NAV1_RADIO_FRACT_DEC | Trigger | 129 |
NAV2_RADIO_FRACT_INC | Trigger | 130 |
NAV2_RADIO_FRACT_DEC | Trigger | 131 |
NAV1_RADIO_WHOLE_INC | Trigger | 132 |
NAV1_RADIO_WHOLE_DEC | Trigger | 133 |
NAV2_RADIO_WHOLE_INC | Trigger | 134 |
NAV2_RADIO_WHOLE_DEC | Trigger | 135 |
RADIO_SELECTED_DME1_IDENT_ENABLE | Trigger | 136 |
RADIO_SELECTED_DME1_IDENT_DISABLE | Trigger | 137 |
RADIO_SELECTED_DME1_IDENT_SET | SetValueCom | 138 |
RADIO_SELECTED_DM1E_IDENT_TOGGLE | Trigger | 139 |
RADIO_SELECTED_DME2_IDENT_ENABLE | Trigger | 140 |
RADIO_SELECTED_DME2_IDENT_DISABLE | Trigger | 141 |
RADIO_SELECTED_DME2_IDENT_SET | SetValueCom | 142 |
RADIO_SELECTED_DME2_IDENT_TOGGLE | Trigger | 143 |
TOGGLE_DME | Trigger | 144 |
RADIO_SELECTED_VOR1_IDENT_ENABLE | Trigger | 145 |
RADIO_SELECTED_VOR1_IDENT_DISABLE | Trigger | 146 |
RADIO_SELECTED_VOR1_IDENT_SET | SetValueCom | 147 |
RADIO_SELECTED_VOR1_IDENT_TOGGLE | Trigger | 148 |
RADIO_SELECTED_VOR2_IDENT_ENABLE | Trigger | 149 |
RADIO_SELECTED_VOR2_IDENT_DISABLE | Trigger | 150 |
RADIO_SELECTED_VOR2_IDENT_SET | SetValueCom | 151 |
RADIO_SELECTED_VOR2_IDENT_TOGGLE | Trigger | 152 |
TOGGLE_VOR | Trigger | 153 |
VOR1_OBI_DEC | Trigger | 154 |
VOR1_OBI_INC | Trigger | 155 |
VOR2_OBI_DEC | Trigger | 156 |
VOR2_OBI_INC | Trigger | 157 |
RADIO_SELECTED_ADF_IDENT_ENABLE | Trigger | 158 |
RADIO_SELECTED_ADF_IDENT_DISABLE | Trigger | 159 |
RADIO_SELECTED_ADF_IDENT_SET | SetValueCom | 160 |
RADIO_SELECTED_ADF_IDENT_TOGGLE | Trigger | 161 |
ADF_CARD_INC | Trigger | 162 |
ADF_CARD_DEC | Trigger | 163 |
ADF_CARD_SET | SetValue | 164 |
ADF_100_INC | Trigger | 165 |
ADF_10_INC | Trigger | 166 |
ADF_1_INC | Trigger | 167 |
ADF_100_DEC | Trigger | 168 |
ADF_10_DEC | Trigger | 169 |
ADF_1_DEC | Trigger | 170 |
ADF_COMPLETE_SET | SetValue | 179 |
ADF1_RADIO_TENTHS_DEC | Trigger | 390 |
ADF1_RADIO_TENTHS_INC | Trigger | 391 |
ADF1_WHOLE_INC | Trigger | 180 |
ADF1_WHOLE_DEC | Trigger | 181 |
ADF2_100_INC | Trigger | 182 |
ADF2_10_INC | Trigger | 183 |
ADF2_1_INC | Trigger | 184 |
ADF2_RADIO_TENTHS_INC | Trigger | 185 |
ADF2_100_DEC | Trigger | 186 |
ADF2_10_DEC | Trigger | 187 |
ADF2_1_DEC | Trigger | 188 |
ADF2_RADIO_TENTHS_DEC | Trigger | 189 |
ADF2_WHOLE_INC | Trigger | 190 |
ADF2_WHOLE_DEC | Trigger | 191 |
ADF2_FRACT_DEC_CARRY | Trigger | 192 |
ADF2_FRACT_INC_CARRY | Trigger | 193 |
ADF2_COMPLETE_SET | SetValue | 194 |
RADIO_ADF2_IDENT_DISABLE | Trigger | 195 |
RADIO_ADF2_IDENT_ENABLE | Trigger | 196 |
RADIO_ADF2_IDENT_TOGGLE | Trigger | 197 |
RADIO_ADF2_IDENT_SET | SetValue | 200 |
XPNDR_1000_INC | Trigger | 171 |
XPNDR_100_INC | Trigger | 172 |
XPNDR_10_INC | Trigger | 173 |
XPNDR_1_INC | Trigger | 174 |
XPNDR_1000_DEC | Trigger | 175 |
XPNDR_100_DEC | Trigger | 176 |
XPNDR_10_DEC | Trigger | 177 |
XPNDR_1_DEC | Trigger | 178 |
XPNDR_SET | SetValue | 201 |
AVIONICS_MASTER_1_SET | SetValueBool | 402 |
AVIONICS_MASTER_1_SET | SetValueBool | 401 |
AVIONICS_MASTER_2_SET | SetValueBool | 404 |
AVIONICS_MASTER_2_SET | SetValueBool | 403 |
BAT_1_ON | Trigger | 0 |
BAT_2_ON | Trigger | 0 |
BAT_1_OFF | Trigger | 0 |
BAT_2_OFF | Trigger | 0 |
PARKING_BRAKES | Trigger | 420 |
TOGGLE_MASTER_1_BATTERY | Trigger | 0 |
TOGGLE_MASTER_2_BATTERY | Trigger | 0 |
TOGGLE_EXTERNAL_POWER | Trigger | 408 |
TOGGLE_MASTER_BATTERY | Trigger | 405 |
TOGGLE_MASTER_BATTERY_ALTERNATOR | Trigger | 407 |
G1000_MFD_ZOOMIN_BUTTON | Trigger | 0 |
G1000_MFD_ZOOMOUT_BUTTON | Trigger | 0 |
AP_MASTER | Trigger | 301 |
AP_PANEL_HEADING_HOLD | Trigger | 302 |
AP_PANEL_ALTITUDE_HOLD | Trigger | 303 |
AP_ATT_HOLD_ON | Trigger | 304 |
AP_LOC_HOLD_ON | Trigger | 305 |
AP_APR_HOLD_ON | Trigger | 306 |
AP_HDG_HOLD_ON | Trigger | 307 |
AP_ALT_HOLD_ON | Trigger | 308 |
AP_WING_LEVELER_ON | Trigger | 309 |
AP_BC_HOLD_ON | Trigger | 310 |
AP_NAV1_HOLD_ON | Trigger | 311 |
AP_ATT_HOLD_OFF | Trigger | 312 |
AP_LOC_HOLD_OFF | Trigger | 313 |
AP_APR_HOLD_OFF | Trigger | 314 |
AP_HDG_HOLD_OFF | Trigger | 315 |
AP_ALT_HOLD_OFF | Trigger | 316 |
AP_WING_LEVELER_OFF | Trigger | 317 |
AP_BC_HOLD_OFF | Trigger | 318 |
AP_NAV1_HOLD_OFF | Trigger | 319 |
AP_AIRSPEED_HOLD | Trigger | 320 |
AP_PANEL_SPEED_HOLD | Trigger | 321 |
AP_ALT_VAR_INC | Trigger | 322 |
AP_ALT_VAR_DEC | Trigger | 323 |
AP_VS_VAR_INC | Trigger | 324 |
AP_VS_VAR_DEC | Trigger | 325 |
AP_SPD_VAR_INC | Trigger | 326 |
AP_SPD_VAR_DEC | Trigger | 327 |
AP_PANEL_MACH_HOLD | Trigger | 328 |
AP_MACH_VAR_INC | Trigger | 329 |
AP_MACH_VAR_DEC | Trigger | 330 |
AP_MACH_HOLD | Trigger | 331 |
AP_ALT_VAR_SET_METRIC | SetValue | 332 |
AP_VS_VAR_SET_ENGLISH | SetValue | 333 |
AP_SPD_VAR_SET | SetValue | 334 |
AP_MACH_VAR_SET | SetValue | 335 |
AP_AIRSPEED_ON | Trigger | 336 |
AP_AIRSPEED_OFF | Trigger | 337 |
AP_AIRSPEED_SET | SetValue | 338 |
AP_MACH_ON | Trigger | 339 |
AP_MACH_OFF | Trigger | 340 |
AP_MACH_SET | SetValue | 341 |
AP_PANEL_ALTITUDE_ON | Trigger | 342 |
AP_PANEL_ALTITUDE_OFF | Trigger | 343 |
AP_PANEL_ALTITUDE_SET | SetValue | 345 |
AP_PANEL_HEADING_ON | Trigger | 346 |
AP_PANEL_HEADING_OFF | Trigger | 347 |
AP_PANEL_HEADING_SET | SetValue | 348 |
AP_PANEL_MACH_ON | Trigger | 349 |
AP_PANEL_MACH_OFF | Trigger | 350 |
AP_PANEL_MACH_SET | SetValue | 351 |
AP_PANEL_SPEED_ON | Trigger | 352 |
AP_PANEL_SPEED_OFF | Trigger | 353 |
AP_PANEL_SPEED_SET | SetValue | 354 |
AP_ALT_VAR_SET_ENGLISH | SetValue | 355 |
AP_VS_VAR_SET_METRIC | SetValue | 356 |
AP_PANEL_SPEED_HOLD_TOGGLE | Trigger | 357 |
AP_PANEL_MACH_HOLD_TOGGLE | Trigger | 358 |
AP_NAV_SELECT_SET | SetValue | 359 |
AP_PITCH_REF_INC_UP | Trigger | 360 |
AP_PITCH_REF_INC_DN | Trigger | 361 |
AP_PITCH_REF_SELECT | Trigger | 362 |
AP_ATT_HOLD | Trigger | 304 |
AP_LOC_HOLD | Trigger | 364 |
AP_APR_HOLD | Trigger | 365 |
AP_HDG_HOLD | Trigger | 366 |
AP_ALT_HOLD | Trigger | 367 |
AP_WING_LEVELER | Trigger | 368 |
AP_BC_HOLD | Trigger | 369 |
AP_NAV1_HOLD | Trigger | 370 |
HEADING_BUG_INC | Trigger | 371 |
HEADING_BUG_DEC | Trigger | 372 |
TOGGLE_FLIGHT_DIRECTOR | Trigger | 373 |
AP_VS_HOLD | Trigger | 374 |
KOHLSMAN_INC | Trigger | 375 |
KOHLSMAN_DEC | Trigger | 376 |
KOHLSMAN_SET | SetValue | 377 |
AUTO_THROTTLE_ARM | Trigger | 378 |
AUTO_THROTTLE_TO_GA | Trigger | 379 |
FLAPS_UP | Trigger | 501 |
FLAPS_1 | Trigger | 502 |
FLAPS_2 | Trigger | 503 |
FLAPS_3 | Trigger | 504 |
FLAPS_DOWN | Trigger | 505 |
FLAPS_INCR | Trigger | 506 |
FLAPS_DECR | Trigger | 507 |
AXIS_FLAPS_SET | SetValue | 0 |
PITOT_HEAT_TOGGLE | Trigger | 508 |
PITOT_HEAT_ON | Trigger | 509 |
PITOT_HEAT_OFF | Trigger | 510 |
MAGNETO | Trigger | 511 |
MAGNETO_DECR | Trigger | 512 |
MAGNETO_INCR | Trigger | 513 |
MAGNETO1_OFF | Trigger | 514 |
MAGNETO1_RIGHT | Trigger | 515 |
MAGNETO1_LEFT | Trigger | 516 |
MAGNETO1_BOTH | Trigger | 517 |
MAGNETO1_START | Trigger | 518 |
MAGNETO2_OFF | Trigger | 519 |
MAGNETO2_RIGHT | Trigger | 520 |
MAGNETO2_LEFT | Trigger | 521 |
MAGNETO2_BOTH | Trigger | 522 |
MAGNETO2_START | Trigger | 523 |
MAGNETO3_OFF | Trigger | 524 |
MAGNETO3_RIGHT | Trigger | 525 |
MAGNETO3_LEFT | Trigger | 526 |
MAGNETO3_BOTH | Trigger | 527 |
MAGNETO3_START | Trigger | 528 |
MAGNETO4_OFF | Trigger | 529 |
MAGNETO4_RIGHT | Trigger | 530 |
MAGNETO4_LEFT | Trigger | 531 |
MAGNETO4_BOTH | Trigger | 532 |
MAGNETO4_START | Trigger | 533 |
MAGNETO_OFF | Trigger | 534 |
MAGNETO_RIGHT | Trigger | 535 |
MAGNETO_LEFT | Trigger | 536 |
MAGNETO_BOTH | Trigger | 537 |
MAGNETO_START | Trigger | 538 |
MAGNETO1_DECR | Trigger | 539 |
MAGNETO1_INCR | Trigger | 540 |
MAGNETO2_DECR | Trigger | 541 |
MAGNETO2_INCR | Trigger | 542 |
MAGNETO3_DECR | Trigger | 543 |
MAGNETO3_INCR | Trigger | 544 |
MAGNETO4_DECR | Trigger | 545 |
MAGNETO4_INCR | Trigger | 546 |
MAGNETO_SET | SetValue | 547 |
MAGNETO1_SET | SetValue | 548 |
MAGNETO2_SET | SetValue | 549 |
MAGNETO3_SET | SetValue | 550 |
MAGNETO4_SET | SetValue | 551 |
ANTI_ICE_ON | Trigger | 552 |
ANTI_ICE_OFF | Trigger | 553 |
ANTI_ICE_SET | SetValue | 554 |
ANTI_ICE_TOGGLE | Trigger | 555 |
ANTI_ICE_TOGGLE_ENG1 | Trigger | 556 |
ANTI_ICE_TOGGLE_ENG2 | Trigger | 557 |
ANTI_ICE_TOGGLE_ENG3 | Trigger | 558 |
ANTI_ICE_TOGGLE_ENG4 | Trigger | 559 |
ANTI_ICE_SET_ENG1 | SetValue | 560 |
ANTI_ICE_SET_ENG2 | SetValue | 561 |
ANTI_ICE_SET_ENG3 | SetValue | 562 |
ANTI_ICE_SET_ENG4 | SetValue | 563 |
TOGGLE_FUEL_VALVE_ALL | Trigger | 564 |
TOGGLE_FUEL_VALVE_ENG1 | Trigger | 565 |
TOGGLE_FUEL_VALVE_ENG2 | Trigger | 566 |
TOGGLE_FUEL_VALVE_ENG3 | Trigger | 567 |
TOGGLE_FUEL_VALVE_ENG4 | Trigger | 568 |
FUEL_SELECTOR_OFF | Trigger | 569 |
FUEL_SELECTOR_ALL | Trigger | 570 |
FUEL_SELECTOR_LEFT | Trigger | 571 |
FUEL_SELECTOR_RIGHT | Trigger | 572 |
FUEL_SELECTOR_LEFT_AUX | Trigger | 573 |
FUEL_SELECTOR_RIGHT_AUX | Trigger | 574 |
FUEL_SELECTOR_CENTER | Trigger | 575 |
FUEL_SELECTOR_SET | SetValue | 576 |
FUEL_SELECTOR_2_OFF | Trigger | 577 |
FUEL_SELECTOR_2_ALL | Trigger | 578 |
FUEL_SELECTOR_2_LEFT | Trigger | 579 |
FUEL_SELECTOR_2_RIGHT | Trigger | 580 |
FUEL_SELECTOR_2_LEFT_AUX | Trigger | 581 |
FUEL_SELECTOR_2_RIGHT_AUX | Trigger | 582 |
FUEL_SELECTOR_2_CENTER | Trigger | 583 |
FUEL_SELECTOR_2_SET | SetValue | 584 |
FUEL_SELECTOR_3_OFF | Trigger | 585 |
FUEL_SELECTOR_3_ALL | Trigger | 586 |
FUEL_SELECTOR_3_LEFT | Trigger | 587 |
FUEL_SELECTOR_3_RIGHT | Trigger | 588 |
FUEL_SELECTOR_3_LEFT_AUX | Trigger | 589 |
FUEL_SELECTOR_3_RIGHT_AUX | Trigger | 590 |
FUEL_SELECTOR_3_CENTER | Trigger | 591 |
FUEL_SELECTOR_3_SET | SetValue | 592 |
FUEL_SELECTOR_4_OFF | Trigger | 593 |
FUEL_SELECTOR_4_ALL | Trigger | 594 |
FUEL_SELECTOR_4_LEFT | Trigger | 595 |
FUEL_SELECTOR_4_RIGHT | Trigger | 596 |
FUEL_SELECTOR_4_LEFT_AUX | Trigger | 597 |
FUEL_SELECTOR_4_RIGHT_AUX | Trigger | 598 |
FUEL_SELECTOR_4_CENTER | Trigger | 599 |
FUEL_SELECTOR_4_SET | SetValue | 600 |
CROSS_FEED_OPEN | Trigger | 601 |
CROSS_FEED_TOGGLE | Trigger | 602 |
CROSS_FEED_OFF | Trigger | 603 |
G1000_PFD_ZOOMIN_BUTTON | Trigger | 251 |
G1000_PFD_ZOOMOUT_BUTTON | Trigger | 250 |
ELEV_TRIM_DN | Trigger | 604 |
DOWN | Trigger | 605 |
ELEV_TRIM_UP | Trigger | 606 |
ELEV_UP | Trigger | 607 |
SPOILERS_ARM_TOGGLE | Trigger | 608 |
SPOILERS_ON | Trigger | 609 |
SPOILERS_OFF | Trigger | 610 |
SPOILERS_ARM_ON | Trigger | 611 |
SPOILERS_ARM_OFF | Trigger | 612 |
AILERON_TRIM_LEFT | Trigger | 613 |
AILERON_TRIM_RIGHT | Trigger | 614 |
RUDDER_TRIM_LEFT | Trigger | 615 |
RUDDER_TRIM_RIGHT | Trigger | 616 |
COWLFLAP1_SET | SetValue | 617 |
COWLFLAP2_SET | SetValue | 618 |
COWLFLAP3_SET | SetValue | 619 |
COWLFLAP4_SET | SetValue | 620 |
INC_COWL_FLAPS | Trigger | 621 |
DEC_COWL_FLAPS | Trigger | 622 |
DEC_COWL_FLAPS1 | Trigger | 624 |
INC_COWL_FLAPS1 | Trigger | 623 |
DEC_COWL_FLAPS2 | Trigger | 626 |
DEC_COWL_FLAPS3 | Trigger | 628 |
DEC_COWL_FLAPS4 | Trigger | 630 |
INC_COWL_FLAPS2 | Trigger | 625 |
INC_COWL_FLAPS3 | Trigger | 627 |
INC_COWL_FLAPS4 | Trigger | 629 |
FUEL_PUMP | Trigger | 631 |
TOGGLE_ELECT_FUEL_PUMP | Trigger | 632 |
TOGGLE_ELECT_FUEL_PUMP1 | Trigger | 634 |
TOGGLE_ELECT_FUEL_PUMP2 | Trigger | 636 |
TOGGLE_ELECT_FUEL_PUMP3 | Trigger | 638 |
TOGGLE_ELECT_FUEL_PUMP4 | Trigger | 640 |
ENGINE_PRIMER | Trigger | 637 |
TOGGLE_PRIMER | Trigger | 638 |
TOGGLE_PRIMER1 | Trigger | 639 |
TOGGLE_PRIMER2 | Trigger | 640 |
TOGGLE_PRIMER3 | Trigger | 641 |
TOGGLE_PRIMER4 | Trigger | 642 |
TOGGLE_FEATHER_SWITCHES | Trigger | 643 |
TOGGLE_FEATHER_SWITCH_1 | Trigger | 644 |
TOGGLE_FEATHER_SWITCH_2 | Trigger | 645 |
TOGGLE_FEATHER_SWITCH_3 | Trigger | 646 |
TOGGLE_FEATHER_SWITCH_4 | Trigger | 647 |
TOGGLE_PROPELLER_SYNC | Trigger | 648 |
TOGGLE_AUTOFEATHER_ARM | Trigger | 649 |
TOGGLE_AFTERBURNER | Trigger | 650 |
TOGGLE_AFTERBURNER1 | Trigger | 651 |
TOGGLE_AFTERBURNER2 | Trigger | 652 |
TOGGLE_AFTERBURNER3 | Trigger | 653 |
TOGGLE_AFTERBURNER4 | Trigger | 654 |
ENGINE | Trigger | 655 |
SPOILERS_TOGGLE | Trigger | 656 |
TOGGLE_STARTER1 | Trigger | 657 |
TOGGLE_STARTER2 | Trigger | 658 |
TOGGLE_STARTER3 | Trigger | 659 |
TOGGLE_STARTER4 | Trigger | 660 |
TOGGLE_ALL_STARTERS | Trigger | 661 |
ENGINE_AUTO_START | Trigger | 662 |
ENGINE_AUTO_SHUTDOWN | Trigger | 663 |
FUEL_SELECTOR_LEFT_MAIN | Trigger | 664 |
FUEL_SELECTOR_2_LEFT_MAIN | Trigger | 665 |
FUEL_SELECTOR_3_LEFT_MAIN | Trigger | 666 |
FUEL_SELECTOR_4_LEFT_MAIN | Trigger | 667 |
FUEL_SELECTOR_RIGHT_MAIN | Trigger | 668 |
FUEL_SELECTOR_2_RIGHT_MAIN | Trigger | 669 |
FUEL_SELECTOR_3_RIGHT_MAIN | Trigger | 670 |
FUEL_SELECTOR_4_RIGHT_MAIN | Trigger | 671 |
APU_STARTER | Trigger | 672 |
APU_OFF_SWITCH | Trigger | 673 |
APU_GENERATOR_SWITCH_TOGGLE | Trigger | 674 |
CABIN_NO_SMOKING_ALERT_SWITCH_TOGGLE | Trigger | 675 |
STROBES_TOGGLE | Trigger | 677 |
CABIN_SEATBELTS_ALERT_SWITCH_TOGGLE | Trigger | 676 |
ALL_LIGHTS_TOGGLE | Trigger | 678 |
PANEL_LIGHTS_TOGGLE | Trigger | 679 |
LANDING_LIGHTS_TOGGLE | Trigger | 680 |
LANDING_LIGHT_UP | Trigger | 681 |
LANDING_LIGHT_DOWN | Trigger | 682 |
LANDING_LIGHT_LEFT | Trigger | 683 |
LANDING_LIGHT_RIGHT | Trigger | 684 |
LANDING_LIGHT_HOME | Trigger | 685 |
STROBES_ON | Trigger | 686 |
STROBES_OFF | Trigger | 687 |
PANEL_LIGHTS_ON | Trigger | 688 |
PANEL_LIGHTS_OFF | Trigger | 689 |
LANDING_LIGHTS_ON | Trigger | 690 |
LANDING_LIGHTS_OFF | Trigger | 691 |
TOGGLE_BEACON_LIGHTS | Trigger | 692 |
TOGGLE_TAXI_LIGHTS | Trigger | 693 |
TOGGLE_LOGO_LIGHTS | Trigger | 694 |
TOGGLE_RECOGNITION_LIGHTS | Trigger | 695 |
TOGGLE_WING_LIGHTS | Trigger | 696 |
TOGGLE_NAV_LIGHTS | Trigger | 697 |
TOGGLE_CABIN_LIGHTS | Trigger | 698 |
GEAR_UP | Trigger | 699 |
GEAR_DOWN | Trigger | 700 |
TOGGLE_STRUCTURAL_DEICE | Trigger | 701 |
TOGGLE_PROPELLER_DEICE | Trigger | 702 |
TOGGLE_ALTERNATOR1 | Trigger | 703 |
TOGGLE_ALTERNATOR2 | Trigger | 704 |
TOGGLE_ALTERNATOR3 | Trigger | 705 |
TOGGLE_ALTERNATOR4 | Trigger | 706 |
ATC | Trigger | 707 |
ATC_MENU_1 | Trigger | 708 |
ATC_MENU_2 | Trigger | 709 |
ATC_MENU_3 | Trigger | 710 |
ATC_MENU_4 | Trigger | 711 |
ATC_MENU_5 | Trigger | 712 |
ATC_MENU_6 | Trigger | 713 |
ATC_MENU_7 | Trigger | 714 |
ATC_MENU_8 | Trigger | 715 |
ATC_MENU_9 | Trigger | 716 |
ATC_MENU_0 | Trigger | 717 |
EGT1_INC | Trigger | 718 |
EGT1_DEC | Trigger | 719 |
EGT2_INC | Trigger | 720 |
EGT2_DEC | Trigger | 721 |
EGT3_INC | Trigger | 722 |
EGT3_DEC | Trigger | 723 |
EGT4_INC | Trigger | 724 |
EGT4_DEC | Trigger | 725 |
EGT_INC | Trigger | 726 |
EGT_DEC | Trigger | 727 |
TOGGLE_GPS_DRIVES_NAV1 | Trigger | 728 |
GPS_POWER_BUTTON | Trigger | 729 |
GPS_NEAREST_BUTTON | Trigger | 730 |
GPS_OBS_BUTTON | Trigger | 731 |
GPS_MSG_BUTTON | Trigger | 732 |
GPS_MSG_BUTTON_DOWN | Trigger | 733 |
GPS_MSG_BUTTON_UP | Trigger | 734 |
GPS_FLIGHTPLAN_BUTTON | Trigger | 735 |
GPS_TERRAIN_BUTTON | Trigger | 736 |
GPS_PROCEDURE_BUTTON | Trigger | 737 |
GPS_ZOOMIN_BUTTON | Trigger | 738 |
GPS_ZOOMOUT_BUTTON | Trigger | 739 |
GPS_DIRECTTO_BUTTON | Trigger | 740 |
GPS_MENU_BUTTON | Trigger | 741 |
GPS_CLEAR_BUTTON | Trigger | 742 |
GPS_CLEAR_ALL_BUTTON | Trigger | 743 |
GPS_CLEAR_BUTTON_DOWN | Trigger | 744 |
GPS_CLEAR_BUTTON_UP | Trigger | 745 |
GPS_ENTER_BUTTON | Trigger | 746 |
GPS_CURSOR_BUTTON | Trigger | 747 |
GPS_GROUP_KNOB_INC | Trigger | 748 |
GPS_GROUP_KNOB_DEC | Trigger | 749 |
GPS_PAGE_KNOB_INC | Trigger | 750 |
GPS_PAGE_KNOB_DEC | Trigger | 751 |
YAW_DAMPER_TOGGLE | Trigger | 752 |
AP_MAX_BANK_INC | Trigger | 803 |
AP_MAX_BANK_DEC | Trigger | 804 |
GYRO_DRIFT_INC | Trigger | 805 |
GYRO_DRIFT_DEC | Trigger | 806 |
TRUE_AIRSPEED_CAL_INC | Trigger | 807 |
TRUE_AIRSPEED_CAL_DEC | Trigger | 808 |
DECREASE_DECISION_HEIGHT | Trigger | 809 |
INCREASE_DECISION_HEIGHT | Trigger | 810 |
SIM_PAUSE_ON | Trigger | 908 |
SIM_PAUSE_OFF | Trigger | 909 |
Outputs
In this chapter we'll go over the information needed to retrieve data from Microsoft Flight Simulator 2020 and send it to your controller. The simulator requires us to indicate which data we want to subscribe to. This enables us to only focus on the relevant data without having to filter out unwanted data. It would be a waste of logic having to handle your indicated altitude when you only want to access the latest nav frequency. That is why the first step will be to create a bundle of outputs. //TODO: link to pages i.e. custom events
Bundle creation
A bundle is a group of outputs that tell the connector which data to request from the simulator. To receive data on your controller we first have to create a bundle. It's recommended to create a bundle for each controller that you want to connect. Let's go over the steps required to receive your indicated altitude and the current com frequency 1.
- Go to the bundle menu (in the top navbar events -> bundle settings)
- Click the green encircled + button to create your first bundle
- Give it a descriptive name
- Your new bundle should now appear in the available bundles
- Click the pencil on the right side of your new bundle
- Navigate to the Nav and Coms tab
- Select com active frequency 1
- Navigate to the instruments tab
- Select indicated altitude
- Hit the save icon next to the title of your bundle
//TODO: Add images
In this example we've created a rather minimalistic set. If your use case requires different events you now know where to look.
Starting the connection
Each controller can subscribe to a single bundle. On the other hand multiple controllers are able to subscribe to the same bundle. But in order for the connector to send the right data to the right controller we have to link them together. This will be done from the home screen. Lets go over the steps required to send your first data.
- From the home screen select your controller from the com port selector.
- Select your newly created bundle in the bundle column.
- Press the green start button
If you've already connected multiple controllers that you'd like to connect you can add a new row by clicking the green add button. Repeat these steps for the amount of controllers required.
//TODO: Add images
Receiving the data
Now we've got everything setup to transmit data we need to setup the receiver. In this example we will connect an I2C LCD screen to our controller in order to display our data.
#include <BitsAndDroidsFlightConnector.h>
#include <LiquidCrystal_I2C.h>
BitsAndDroidsFlightConnector conn = BitsAndDroidsFlightConnector();
LiquidCrystal_I2C lcd(0x27,20,4);
long currentActiveCom = 0;
int currentIndicatedAltitude = 0;
void setup() {
lcd.init();
lcd.backlight();
Serial.begin(115200);
}
void displayCom1(long com){
lcd.setCursor(0,0);
lcd.print(com);
}
void displayIndicatedAlt(int alt){
lcd.setCursor(0,1);
lcd.print(alt);
}
void loop() {
//This polls the serial line for incomming messages
conn.dataHandling();
long activeCom = conn.getActiveCom1();
int indicatedAltitude = conn.getIndicatedAltitude();
if (activeCom != currentActiveCom){
currentActiveCom = activeCom;
displayCom1(activeCom);
}
if (currentIndicatedAltitude != indicatedAltitude){
currentIndicatedAltitude = indicatedAltitude;
displayIndicatedAlt(indicatedAltitude);
}
}
Outputs
Simvar | Metric | Update Every | Callback Text | Id | Output Type | Category |
---|---|---|---|---|---|---|
AMBIENT PRESSURE | inHG | 0.01 | Ambient pressure | 650 | INHG | Environment |
AMBIENT TEMPERATURE | Celsius | 0.1 | Ambient temperature | 651 | Float2DecPlaces | Environment |
AMBIENT WIND VELOCITY | Knots | 0.1 | Ambient wind velocity | 652 | Float1DecPlaces | Environment |
AMBIENT WIND DIRECTION | Degrees | 1 | Ambient wind direction | 653 | Integer | Environment |
AMBIENT PRECIP RATE | millimeters of water | 1 | Ambient precipitation rate | 654 | Integer | Environment |
THROTTLE LOWER LIMIT | Percent Over 100 | 0.01 | Throttle lower limit | 655 | Percentage | Engines |
PLANE HEADING DEGREES GYRO | Degrees | 0.1 | plane heading degrees gyro | 656 | Integer | Data |
PLANE HEADING DEGREES MAGNETIC | Radians | 0.01 | plane heading degrees magnetic | 657 | Degrees | Data |
PLANE HEADING DEGREES TRUE | Radians | 0.01 | Plane heading degrees true | 658 | Degrees | Data |
INDICATED_ALTITUDE_CALIBRATED | Feet | 1 | Indicated altitude calibrated | 659 | Integer | Instruments |
FUEL SELECTED QUANTITY PERCENT | Percent Over 100 | 0.01 | Fuel quantity % | 275 | Percentage | Fuel |
AUTOPILOT AIRSPEED HOLD VAR | knots | 0 | AP airspeed var | 700 | Integer | Fuel |
FUEL TANK CENTER LEVEL | Percent Over 100 | 0.01 | Fuel tank center level | 234 | Percentage | Fuel |
FUEL TANK CENTER2 LEVEL | Percent Over 100 | 0.01 | Fuel tank center 2 level | 235 | Percentage | Fuel |
FUEL TANK CENTER3 LEVEL | Percent Over 100 | 0.01 | Fuel tank center 3 level | 236 | Percentage | Fuel |
FUEL TANK LEFT MAIN LEVEL | Percent Over 100 | 0.01 | Fuel tank left main level | 237 | Percentage | Fuel |
FUEL TANK LEFT AUX LEVEL | Percent Over 100 | 0.01 | Fuel tank left aux level | 238 | Percentage | Fuel |
FUEL TANK LEFT TIP LEVEL | Percent Over 100 | 0.01 | Fuel tank left tip level | 239 | Percentage | Fuel |
FUEL TANK RIGHT MAIN LEVEL | Percent Over 100 | 0.01 | Fuel tank right main level | 240 | Percentage | Fuel |
FUEL TANK RIGHT AUX LEVEL | Percent Over 100 | 0.01 | Fuel tank right aux level | 241 | Percentage | Fuel |
FUEL TANK RIGHT TIP LEVEL | Percent Over 100 | 0.01 | Fuel tank right tip level | 242 | Percentage | Fuel |
FUEL TANK EXTERNAL1 LEVEL | Percent Over 100 | 0.01 | Fuel tank external 1 level | 243 | Percentage | Fuel |
FUEL TANK EXTERNAL2 LEVEL | Percent Over 100 | 0.01 | Fuel tank external 2 level | 244 | Percentage | Fuel |
FUEL TANK CENTER CAPACITY | Gallons | 1 | Fuel tank center capacity | 245 | Integer | Fuel |
FUEL TANK CENTER2 CAPACITY | Gallons | 1 | Fuel tank center 2 capacity | 246 | Integer | Fuel |
FUEL TANK CENTER3 CAPACITY | Gallons | 1 | Fuel tank center 3 capacity | 247 | Integer | Fuel |
FUEL TANK LEFT MAIN CAPACITY | Gallons | 1 | Fuel tank left main capacity | 248 | Integer | Fuel |
FUEL TANK LEFT AUX CAPACITY | Gallons | 1 | Fuel tank left aux capacity | 249 | Integer | Fuel |
FUEL TANK LEFT TIP CAPACITY | Gallons | 1 | Fuel tank left tip capacity | 250 | Integer | Fuel |
FUEL TANK RIGHT MAIN CAPACITY | Gallons | 1 | Fuel tank right main capacity | 251 | Integer | Fuel |
FUEL TANK RIGHT AUX CAPACITY | Gallons | 1 | Fuel tank right aux capacity | 252 | Integer | Fuel |
FUEL TANK RIGHT TIP CAPACITY | Gallons | 1 | Fuel tank right tip capacity | 253 | Integer | Fuel |
FUEL TANK EXTERNAL1 CAPACITY | Gallons | 1 | Fuel tank external 1 capacity | 254 | Integer | Fuel |
FUEL TANK EXTERNAL2 CAPACITY | Gallons | 1 | Fuel tank external 2 capacity | 255 | Integer | Fuel |
FUEL LEFT CAPACITY | Gallons | 1 | Fuel left capacity | 256 | Integer | Fuel |
FUEL RIGHT CAPACITY | Gallons | 1 | Fuel right capacity | 257 | Integer | Fuel |
FUEL TANK CENTER QUANTITY | Gallons | 1 | Fuel tank center quantity | 258 | Integer | Fuel |
FUEL TANK CENTER2 QUANTITY | Gallons | 1 | Fuel tank center 2 quantity | 259 | Integer | Fuel |
FUEL TANK CENTER3 QUANTITY | Gallons | 1 | Fuel tank center 3 quantity | 260 | Integer | Fuel |
FUEL TANK LEFT MAIN QUANTITY | Gallons | 1 | Fuel tank left main quantity | 261 | Integer | Fuel |
FUEL TANK LEFT AUX QUANTITY | Gallons | 1 | Fuel tank left aux quantity | 262 | Integer | Fuel |
FUEL TANK LEFT TIP QUANTITY | Gallons | 1 | Fuel tank left tip quantity | 263 | Integer | Fuel |
FUEL TANK RIGHT MAIN QUANTITY | Gallons | 1 | Fuel tank right main quantity | 264 | Integer | Fuel |
FUEL TANK RIGHT AUX QUANTITY | Gallons | 1 | Fuel tank right aux quantity | 265 | Integer | Fuel |
FUEL TANK RIGHT TIP QUANTITY | Gallons | 1 | Fuel tank right tip quantity | 266 | Integer | Fuel |
FUEL TANK EXTERNAL1 QUANTITY | Gallons | 1 | Fuel tank external 1 | 267 | Integer | Fuel |
FUEL TANK EXTERNAL2 QUANTITY | Gallons | 1 | Fuel tank external 2 quantity | 268 | Integer | Fuel |
FUEL LEFT QUANTITY | Gallons | 1 | Fuel left quantity | 269 | Integer | Fuel |
FUEL RIGHT QUANTITY | Gallons | 1 | Fuel right quantity | 270 | Integer | Fuel |
FUEL TOTAL QUANTITY | Gallons | 1 | Fuel total quantity | 271 | Integer | Fuel |
PLANE ALT ABOVE GROUND | Feet | 100 | Feet above ground | 312 | Integer | Data |
SIM ON GROUND | Bool | 0 | (bool) on the ground | 323 | Boolean | Data |
VERTICAL SPEED | Feet per second | 10 | Vertical speed | 330 | Integer | Data |
TITLE | NULL | 0 | Plane name | 999 | Percentage | Data |
BAROMETER PRESSURE | Millibars | 10 | Barometer pressure | 632 | Integer | Instruments |
AIRSPEED INDICATED | Knots | 1 | Indicated airspeed | 326 | Integer | Instruments |
HEADING INDICATOR | Radians | 0.02 | Indicated heading | 344 | Degrees | Instruments |
VARIOMETER RATE | Feet per minute | 10 | Vario rate | 345 | Integer | Instruments |
INDICATED ALTITUDE | Feet | 10 | Indicated altitude | 335 | Integer | Instruments |
INDICATED ALTITUDE:2 | Feet | 10 | indicated altitude | 336 | Integer | Instruments |
KOHLSMAN SETTING HG | inHg | 0 | Kohlsman HG | 337 | INHG | Instruments |
LOCAL TIME | Seconds | 1 | Local time | 338 | SecondsAfterMidnight | Data |
TIME ZONE OFFSET | Seconds | 1 | Zulu time | 339 | Integer | Data |
ZULU TIME | Seconds | 1 | Zulu time | 340 | SecondsAfterMidnight | Data |
GPS GROUND SPEED | Meters per second | 1 | GPS groundspeed | 430 | MetersPerSecondToKnots | GPS |
GPS WP BEARING | Degrees | 1 | GPS course to steer | 454 | Integer | GPS |
AUTOPILOT HEADING LOCK DIR | Degrees | 0 | AP heading lock | 582 | Integer | Autopilot |
AUTOPILOT ALTITUDE LOCK VAR | Feet | 0 | AP altitude lock var | 584 | Integer | Autopilot |
AUTOPILOT VERTICAL HOLD VAR | Feet/minute | 0 | AP vertical hold var | 590 | Integer | Autopilot |
AUTOPILOT AVAILABLE | Bool | 0 | (bool) AP available | 576 | Boolean | Autopilot |
AUTOPILOT MASTER | Bool | 0 | (bool) AP master | 577 | Boolean | Autopilot |
AUTOPILOT WING LEVELER | Bool | 0 | (bool) AP wing leveler | 579 | Boolean | Autopilot |
AUTOPILOT HEADING LOCK | Bool | 0 | (bool) AP heading lock | 581 | Boolean | Autopilot |
AUTOPILOT ALTITUDE LOCK | Bool | 0 | (bool) AP altitude lock | 583 | Boolean | Autopilot |
AUTOPILOT ATTITUDE HOLD | Bool | 0 | (bool) AP attitude lock | 585 | Boolean | Autopilot |
AUTOPILOT GLIDESLOPE HOLD | Bool | 0 | (bool) AP glideslope hold | 586 | Boolean | Autopilot |
AUTOPILOT APPROACH HOLD | Bool | 0 | (bool) AP approach hold | 588 | Boolean | Autopilot |
AUTOPILOT BACKCOURSE HOLD | Bool | 0 | (bool) AP backcourse hold | 589 | Boolean | Autopilot |
AUTOPILOT FLIGHT DIRECTOR ACTIVE | Bool | 0 | (bool) AP flight director | 591 | Boolean | Autopilot |
AUTOPILOT AIRSPEED HOLD | Bool | 0 | (bool) AP airspeed hold | 594 | Boolean | Autopilot |
AUTOPILOT MACH HOLD | Bool | 0 | (bool) AP mach hold | 596 | Boolean | Autopilot |
AUTOPILOT YAW DAMPER | Bool | 0 | (bool) AP yaw damper | 598 | Boolean | Autopilot |
AUTOPILOT THROTTLE ARM | Bool | 0 | (bool) AP throttle arm | 600 | Boolean | Autopilot |
AUTOPILOT TAKEOFF POWER ACTIVE | Bool | 0 | (bool) AP takeoff power | 601 | Boolean | Autopilot |
AUTOTHROTTLE ACTIVE | Bool | 0 | (bool) Autothrottle | 602 | Boolean | Autopilot |
AUTOPILOT NAV1 LOCK | Bool | 0 | (bool) AP NAV1 lock | 580 | Boolean | Autopilot |
AUTOPILOT VERTICAL HOLD | Bool | 0 | (bool) AP vertical hold | 604 | Boolean | Autopilot |
AUTOPILOT RPM HOLD | Bool | 0 | (bool) AP RPM hold | 605 | Boolean | Autopilot |
COM ACTIVE FREQUENCY:1 | Khz | 0 | Com 1 active | 900 | Integer | NAV and COMS |
COM ACTIVE FREQUENCY:2 | Khz | 0 | Com 2 active | 902 | Integer | NAV and COMS |
COM STANDBY FREQUENCY:1 | Khz | 0 | Com 1 standby | 901 | Integer | NAV and COMS |
COM STANDBY FREQUENCY:2 | Khz | 0 | Com 2 standby | 903 | Integer | NAV and COMS |
NAV ACTIVE FREQUENCY:1 | KHz | 0 | NAV 1 active | 910 | Integer | NAV and COMS |
NAV STANDBY FREQUENCY:1 | KHz | 0 | NAV 1 standby | 911 | Integer | NAV and COMS |
NAV ACTIVE FREQUENCY:2 | KHz | 0 | NAV 2 active | 912 | Integer | NAV and COMS |
NAV STANDBY FREQUENCY:2 | KHz | 0 | NAV 2 standby | 913 | Integer | NAV and COMS |
NAV RADIAL ERROR:1 | Degrees | 0 | NAV 1 radial error | 914 | Integer | NAV and COMS |
NAV VOR LATLONALT:1 | SIMCONNECT_DATA_LATLONALT | 0 | Nav 1 VOR LATLONALT | 915 | Integer | NAV and COMS |
ADF ACTIVE FREQUENCY:1 | Hz | 0 | ADF 1 active | 954 | ADF | NAV and COMS |
ADF STANDBY FREQUENCY:1 | Hz | 0 | ADF 1 standby | 955 | ADF | NAV and COMS |
ADF RADIAL:1 | Degrees | 0 | ADF 1 radial | 956 | Integer | NAV and COMS |
ADF SIGNAL:1 | Number | 0 | ADF 1 signal | 957 | Integer | NAV and COMS |
ADF ACTIVE FREQUENCY:2 | Hz | 0 | ADF 2 active | 958 | ADF | NAV and COMS |
ADF STANDBY FREQUENCY:2 | Hz | 0 | ADF 2 standby | 959 | ADF | NAV and COMS |
ADF RADIAL:2 | Degrees | 0 | ADF 2 radial | 960 | Integer | NAV and COMS |
ADF SIGNAL:2 | Number | 0 | ADF 2 signal | 961 | Integer | NAV and COMS |
NAV DME:1 | Nautical miles | 0 | NAV DME 1 | 950 | Integer | NAV and COMS |
NAV DMESPEED:1 | Knots | 0 | NAV DME 1 speed | 951 | Integer | NAV and COMS |
NAV DME:2 | Nautical miles | 0 | NAV DME 2 | 952 | Integer | NAV and COMS |
NAV DMESPEED:2 | Knots | 0 | NAV DME 2 speed | 953 | Integer | NAV and COMS |
TRANSPONDER CODE:1 | number | 0 | Transponder 1 code | 962 | Integer | NAV and COMS |
TRANSPONDER CODE:2 | number | 0 | Transponder 2 code | 963 | Integer | NAV and COMS |
NAV OBS:1 | Degrees | 0.1 | NAV OBS 1 | 606 | Integer | NAV and COMS |
NAV OBS:2 | Degrees | 0.1 | NAV OBS 2 | 607 | Integer | NAV and COMS |
TRANSPONDER IDENT:1 | Bool | 0 | Transponder ident 1 | 608 | Integer | NAV and COMS |
TRANSPONDER STATE:1 | Enum | 0 | Transponder state 1 | 609 | Integer | NAV and COMS |
TRANSPONDER IDENT:2 | Bool | 0 | Transponder ident 2 | 610 | Integer | NAV and COMS |
TRANSPONDER STATE:2 | Enum | 0 | Transponder state 2 | 611 | Integer | NAV and COMS |
LIGHT TAXI ON | Bool | 0 | (bool) Taxi lights | 133 | Boolean | Lights |
LIGHT STROBE ON | Bool | 0 | (bool) Strobe lights | 134 | Boolean | Lights |
LIGHT PANEL ON | Bool | 0 | (bool) Panel lights | 135 | Boolean | Lights |
LIGHT RECOGNITION ON | Bool | 0 | (bool) Recognition lights | 136 | Boolean | Lights |
LIGHT WING ON | Bool | 0 | (bool) Wing lights | 137 | Boolean | Lights |
LIGHT LOGO ON | Bool | 0 | (bool) Logo lights | 138 | Boolean | Lights |
LIGHT CABIN ON | Bool | 0 | (bool) Cabin lights | 139 | Boolean | Lights |
LIGHT HEAD ON | Bool | 0 | (bool) Head light | 140 | Boolean | Lights |
LIGHT BRAKE ON | Bool | 0 | (bool) Brake lights (not the brakes!) | 141 | Boolean | Lights |
LIGHT NAV ON | Bool | 0 | (bool) NAV lights | 142 | Boolean | Lights |
LIGHT BEACON ON | Bool | 0 | (bool) Beacon lights | 143 | Boolean | Lights |
LIGHT LANDING ON | Bool | 0 | (bool) Landing lights | 144 | Boolean | Lights |
STALL WARNING | Bool | 0 | (bool) Stall warning | 333 | Boolean | Warnings |
OVERSPEED WARNING | Bool | 0 | (bool) Overspeed warning | 334 | Boolean | Warnings |
BRAKE PARKING INDICATOR | Bool | 0 | (bool) Parking brake indicator | 505 | Boolean | Mechanical |
AILERON TRIM | Radians | 0 | Aileron trim degrees | 562 | Degrees | Mechanical |
AILERON TRIM PCT | Percent Over 100 | 0.01 | Aileron trim % | 563 | Percentage | Mechanical |
RUDDER TRIM | Radians | 0.01 | Rudder trim degrees | 566 | Degrees | Mechanical |
RUDDER TRIM PCT | Percent Over 100 | 0.01 | Rudder trim % | 567 | Percentage | Mechanical |
ELEVATOR TRIM POSITION | Radians | 0.01 | Elevator trim position degrees | 498 | Degrees | Mechanical |
ELEVATOR TRIM PCT | Percent Over 100 | 0.01 | Elevator trim % | 500 | Percentage | Mechanical |
FLAPS HANDLE PERCENT | Percent Over 100 | 0.01 | Flaps handle % | 510 | Percentage | Mechanical |
FLAPS HANDLE INDEX | Number | 0 | Flaps handle index | 511 | Integer | Mechanical |
FLAPS NUM HANDLE POSITIONS | Number | 0 | Flaps number handle positions | 512 | Integer | Mechanical |
TRAILING EDGE FLAPS LEFT PERCENT | Percent Over 100 | 0.01 | Trailing edge flaps left % | 513 | Percentage | Mechanical |
TRAILING EDGE FLAPS RIGHT PERCENT | Percent Over 100 | 0.01 | Trailing edge flaps right % | 514 | Percentage | Mechanical |
TRAILING EDGE FLAPS LEFT ANGLE | Radians | 0.01 | Trailing edge flaps left degrees | 515 | Degrees | Mechanical |
TRAILING EDGE FLAPS RIGHT ANGLE | Radians | 0.01 | Trailing edge flaps right degree | 516 | Degrees | Mechanical |
LEADING EDGE FLAPS LEFT PERCENT | Percent Over 100 | 0.01 | Leading edge flaps left % | 517 | Percentage | Mechanical |
LEADING EDGE FLAPS RIGHT PERCENT | Percent Over 100 | 0.01 | Leading edge flaps right % | 518 | Percentage | Mechanical |
LEADING EDGE FLAPS LEFT ANGLE | Radians | 0.01 | Leading edge flaps left degrees | 519 | Degrees | Mechanical |
LEADING EDGE FLAPS RIGHT ANGLE | Radians | 0.01 | Leading edge flaps right degrees | 520 | Degrees | Mechanical |
GEAR HANDLE POSITION | Bool | 0 | (bool) Gear handle position | 526 | Boolean | Mechanical |
GEAR HYDRAULIC PRESSURE | psf | 1 | Gear hydraulic pressure | 527 | Integer | Mechanical |
TAILWHEEL LOCK ON | Bool | 0 | (bool) Tailwheel lock | 528 | Boolean | Mechanical |
GEAR CENTER POSITION | Percent Over 100 | 0.01 | Gear center position % | 529 | Percentage | Mechanical |
GEAR LEFT POSITION | Percent Over 100 | 0.01 | Gear left position % | 530 | Percentage | Mechanical |
GEAR RIGHT POSITION | Percent Over 100 | 0.01 | Gear right position % | 531 | Percentage | Mechanical |
GEAR TAIL POSITION | Percent Over 100 | 0.01 | Gear tail position % | 532 | Percentage | Mechanical |
GEAR AUX POSITION | Percent Over 100 | 0.01 | Gear AUX position % | 533 | Percentage | Mechanical |
GEAR TOTAL PCT EXTENDED | Percentage | 0.01 | Gear total extended % | 536 | Percentage | Mechanical |
Presets
Presets are a way to save multiple device configurations for flight simmers that want to match their setup to their needs. This makes it simple to swap your devices when you switch your airliner for a general aviation plane. In short, each preset contains one or multiple bundles (A bundle is a device matched with the outputs it needs to receive) that can be saved as a set.
Your presets can be managed from the home screen. From here, you can create, save, and edit them. Your first preset will be called (what a coincidence) default by default. You’re able to alter this preset to your heart’s desire.
Create a preset
If you want to create a new preset, press the Create new preset button. This prompts you to enter a fitting name. The connector will save the new empty preset to your settings. It will also be selected as the current active preset. To ensure you’re using the correct set, you should see the name of your new set in the dropdown menu. If you hit start for the first time using your new preset, the connector will save the set as the last active preset. If you start the connector, your last preset will be reinstated. The connector defaults to the first available device if the device isn't connected. If this happens, the alternate device won’t be saved to memory unless you manually press the save preset button.
Edit a preset
You can edit your presets by changing the run configuration by adding and removing rows, changing devices, and altering the bundles. Remember to save your changes before changing the preset you’ve equipped.
These changes will automatically be saved when you make changes
Delete a preset
You're able to remove a preset from the manage preset page.
- Click on settings in the main menu
- Navigate to the Manage presets page
- Click on the trashcan to delete the preset
You're not able to delete the default preset
Edit preset name
This is a placeholder. This functionality isn't finished yet.
Settings
In this chapter, we'll go over the connector's available settings. The settings menu can be accessed from the main menu in the settings tab.
Connection settings
These settings affect the way the connector interacts with your devices.
Enable TRS
Iput | checkbox |
Type | boolean |
Default | false |
The terminal-ready signal is a signal that can be sent to your devices when the connector connects to your controller. Specific microcontrollers like the Arduino use this signal to prepare the controller for incoming data. The behavior of this signal depends on the microcontroller manufacturer's implementation. For example, an Arduino Due uses the signal to reset the controller before establishing a serial connection.
If your microcontrollers reset, pay attention to the order of your devices. For example, the Arduino Due has 2 USB ports (programmer and default). When these ports are reset, the order in which the connectors are reset can affect whether the connection is established or dropped. For the Due, it’s recommended that the programming port be placed at the top of the connection rows.
Launch when sim starts
Iput | checkbox |
Type | boolean |
Default | false |
This settings will launch the connector when you start Microsoft Flight Simulator 2020. At the moment it just opens the application but doesn't start a connection (this is being worked on). In order to achieve this the connector adds an entry to the exe.xml file used by MFS2020. This file is located 2 levels up from the community folder. The connector uses the community folder path to navigate to this file. If no community folder path has been set the connector will ask for the path.
Logs
When tinkering with your projects, seeing what the connector does can provide valuable information.
Log window
You can use the log window to see a live stream of the logs being output. The log window can be accessed from the main menu. It shows the last 1000 log entries. The logs can fill up quite rapidly if you send a lot of data to or from your controller. If you need some breathing room to analyze the logs, you’re able to pause and resume the log stream using the pause button.
Log file
Looking for information about events that happened when the log window was closed? Don’t worry. All logs get saved to an external file as well. This provides a more accessible format to share during a bug report as well. On Windows, you can type %localappdata% in the file explorer address bar to navigate to your appdata/local folder. The log files can be found in the bitsanddroids/logs folder.
WASM
Usually, the connector communicates with MFS2020 using SimConnect. SimConnect is an interface that exposes the simulation data to other software. This interface provides an easy way to start consuming the sim data but has some downsides.
One of these downsides is that third-party developers can’t easily add functionality to this interface when they want to implement new features. The result for you as a user is that some interactions are locked in the simulator.
Luckily, there is an answer to this problem! MFS2020 provides functionality that lets an add-on interact with the in-game data. Even the data that isn’t created by the add-on itself. These add-ons are called WASM (web-assembly) modules. These WASM modules live inside the simulator but can talk to the outside world using SimConnect. There are other ways these modules can communicate to the outside world, but since we’re already utilizing SimConnect, this route will be our pick.
The great benefit of this system is that we can add more functionality to this module when necessary. That way we’re able to interact with new aircraft the moment they’re released.
Custom events
As explained in the previous chapter not all events can be accessed through SimConnect. Using the WASM module we're able to utilize a whole new set of functionalities. You're able to send data to MFS or receive data and send it to your microcontroller. Since there are more third party planes available than my wallet allows me to obtain it's not possible to add events for everyone of them to the connector. By adding custom events you're able to control event the most obscure aircraft. These events are formatted using Reverse Polish Notation. The connector calls these actions custom commands. You're able to see and edit the custom commands from the custom events menu under the events menu.
Events broken down
An event can be broken down in smaller parts.
- ID
- Actions
- Description
- Type
- Category
- Output format
- Update every
ID
The ID is used to identify the event. When the event is defined as an input, you can trigger it by sending the ID to the connector. The connector will then trigger the corresponding action. When the event is defined as an output the connector will prefix the value with the ID. This makes it possible to identify the received value on your controller.
Action
The action is the event that will be triggered if the connector receives the corresponding ID or the data that MFS requests.
HubHop is a website that contains a library of events created by other simmers.
You can add logical/conditional steps into these events to create complex events.
An example of a more complex event is:
(A:AUTOPILOT ALTITUDE LOCK VAR, feet) - 1000 + (>K:AP_ALT_VAR_SET_ENGLISH) (>H:AP_KNOB_Down)
This basically involves taking the current AP alt lock variable and subtracting 1000, assigning this value to the AP alt variable, and animating the button press.
A simpler event would be 1 (>H:TRANSPONDER:1, Enum)
, which sets the transponder state to mode 1.
Description
Actions can become quite complex and challenging to follow. The description provides a readable description of the event. When the event is defined as an output, the description is also used as a label for the checkbox in the bundle editor.
Type
There are two types of events: inputs and outputs. Inputs are events that are triggered by an incoming message from your controller. To trigger these events, you need to send the ID to the connector. Output events define events that the connector continuously requests from the simulator. If the data changes more than the threshold (update every field), the connector sends the value to your controller, which is prefixed by the ID.
Category
You can add a category to organize your events. This will eventually be used to filter the events table (WIP). In the future, you can add more categories.
Output format
If the event is an output, the output format field will appear. This determines in which format the connector needs to return the data. Available types are:
- Float (1.5)
- Integer (1)
- Time (20:10:10)
- Boolean (true/false or 1/0)
- String (still untested)
Update every
Update every is only applicable to outputs. This value dictates at which interval the connector needs to send data. Let’s say you want to receive the altitude of your aircraft. The simulator will send every altitude change even if it's just a few inches/millimeters. In reality, you're probably more interested in the changes per foot. To achieve this, you could set the update for every value to 1.0.
Update default events
The custom event menu has a button that says update default events. This button resets the default events or adds them if they were added to the connector after your install date. To prevent overwriting of your changes, this isn’t done automatically. In the future you’ll be able to pick and choose which events to import/reset.
Resetting the default events only reinstates the original events the connector ships with (or those added later). It won’t affect events you’ve added yourself.
Library
To make it easier to interface with the connector you're able to utilize the C++ library.
Library generator
You're able to create your own inputs and outputs in the connector. To allow this customization the connector comes with a library generator. The generator will add the outputs you've created to the library. This way the data will be routed to the correct variables in the library.
It's recommended to save the library to your Arduino library folder if using the Arduino IDE
Generated format
The generator will add three components:
- variables
- getters
- switch cases
variables
The added variables are generated in the format output{id} i.e.: int output1000;
The type can be altered by changing the output_format in the event editor.
getters
The generator adds get functions to make it easy to retrieve the latest value of the event you defined.
This function is designed to retrieve the value in a consistent manner.
A getter might look like this: int getOutput1000() { return getOutput1000; }
switch cases
Last but not least the generator adds switch cases. These look like this: case 1000: { output1000 = incommingValue; break; }
These cases will route the incoming values to the correct variables.
PLACEHOLDER
Inputs with values
Using SimConnect with Microsoft Flight Simulator 2020 allows sending values directly to the simulator. Some examples would be:
- Set the com frequency to 124.850
- Set the Kohlman altitude indicator to 29.98
- Set the nav frequency to 116.85
The format expected by the simulator might not always be the direct value. For example the Kohlman altitude indicator requires the value to be passed in Millibars multiplied by 16.
Helper functions
The library has helper functions that parse the desired values into the correct format to simplify their use.
connector.sendSetKohlmanAltimeterInHg(float value)
Expects | The InHg value to set i.e. 29.92 as |
Value type | float |
Converts | Value * 33.8639 (to mb) * 16 |
Sends | “377 16211” |
connector.sendSetKohlmanAltimeterMb(float value)
Expects | The mb value to set i.e. 1011 as |
Value type | float |
Converts | Value * 16 |
Sends | “377 162176” |
Library Functions
Name | Direction | Return Type | Parameters |
---|---|---|---|
getFuelLevel() | Out | int | |
getVersion() | Out | String | |
getConnected() | Out | int | |
getPercentage(int | Out | byte | |
getFeetAboveGround() | Out | int | |
getOnGround() | Out | bool | |
getApVerticalSpeed() | Out | int | |
int | Out | long | |
getGpsCourseToSteer() | Out | int | |
getApHeadingLock() | Out | int | |
getKohlmanAltimeter() | Out | int | |
getBarPressure() | Out | int | |
getFuelTotalPercentage() | Out | byte | |
getIndicatedAirspeed() | Out | int | |
getVarometerRate() | Out | int | |
getIndicatedAltitude() | Out | int | |
getIndicatedAltitude2() | Out | int | |
getIndicatedAltitudeCalibrated() | Out | int | |
getIndicatedHeading() | Out | int | |
getIndicatedGPSGroundspeed() | Out | int | |
getTrueVerticalSpeed() | Out | int | |
getLastPrefix(); | Out | int | |
getLightTaxiOn() | Out | bool | |
getLightStrobeOn() | Out | bool | |
getLightPanelOn() | Out | bool | |
getLightRecognitionOn() | Out | bool | |
getLightWingOn() | Out | bool | |
getLightLogoOn() | Out | bool | |
getLightCabinOn() | Out | bool | |
getLightHeadOn() | Out | bool | |
getLightBrakeOn() | Out | bool | |
getLightNavOn() | Out | bool | |
getLightBeaconOn() | Out | bool | |
getLightLandingOn() | Out | bool | |
getActiveCom1() | Out | long | |
getActiveCom2() | Out | long | |
getStandbyCom1() | Out | long | |
getStandbyCom2() | Out | long | |
getActiveNav1() | Out | long | |
getActiveNav2() | Out | long | |
getStandbyNav1() | Out | long | |
getStandbyNav2() | Out | long | |
getNavRadialError1() | Out | String | |
getNavVorLationalt1() | Out | String | |
getNavObs1() | Out | int | |
getNavObs2() | Out | int | |
getStallWarningOn() | Out | bool | |
getOverspeedWarningOn() | Out | bool | |
getFlapsHandlePct() | Out | byte | |
getFlapsHandleIndex() | Out | byte | |
getFlapsNumHandlePos() | Out | byte | |
getTrailingEdgeFlapsLeftPercent() | Out | byte | |
getTrailingEdgeFlapsRightPercent() | Out | byte | |
getTrailingEdgeFlapsLeftAngle() | Out | int | |
getTrailingEdgeFlapsRightAngle() | Out | int | |
getLeadingEdgeFlapsLeftPct() | Out | byte | |
getLeadingEdgeFlapsRightPct() | Out | byte | |
getLeadingEdgeFlapsLeftAngle() | Out | int | |
getLeadingEdgeFlapsRightAngle() | Out | int | |
getGearHandlePos() | Out | bool | |
getGearHydraulicPressure() | Out | int | |
getTailWheelLock() | Out | bool | |
getGearCenterPositionPct() | Out | byte | |
getGearLeftPositionPct() | Out | byte | |
getGearRightPositionPct() | Out | byte | |
getGearTailPositionPct() | Out | byte | |
getGearAuxPosition() | Out | byte | |
getGearTotalPct() | Out | byte | |
getAileronTrimPct() | Out | int | |
getAileronTrimDegr() | Out | int | |
getRudderTrimDegr() | Out | int | |
getRudderTrimPct() | Out | int | |
getElevatorTrimPos() | Out | int | |
getElevatorTrimPct() | Out | int | |
getNavDme1() | Out | String | |
getNavDme2() | Out | String | |
getNavDmeSpeed1() | Out | String | |
getNavDmeSpeed2() | Out | String | |
getAdfActiveFreq1() | Out | long | |
getAdfStandbyFreq1() | Out | long | |
getAdfRadial1() | Out | String | |
getAdfSignal1() | Out | String | |
getAdfActiveFreq2() | Out | long | |
getAdfStandbyFreq2() | Out | long | |
getAdfRadial2() | Out | String | |
getAdfSignal2() | Out | String | |
getTransponderCode1() | Out | String | |
getTransponderCode2() | Out | String | |
getTransponderIdent1() | Out | bool | |
getTransponderIdent2() | Out | bool | |
getTransponderState1() | Out | uint8_t | |
getTransponderState2() | Out | uint8_t | |
getAPAvailable() | Out | bool | |
getAPMasterOn() | Out | bool | |
getAPWingLevelerOn() | Out | bool | |
getAPNav1LockOn() | Out | bool | |
getAPHeadingLockOn() | Out | bool | |
getAPAltitudeLockOn() | Out | bool | |
getAPAttitudeLockOn() | Out | bool | |
getAPGlideslopeHoldOn() | Out | bool | |
getAPApproachHoldOn() | Out | bool | |
getAPBackcourseHoldOn() | Out | bool | |
getAPFlightDirectorOn() | Out | bool | |
getAPAirspeedHoldOn() | Out | bool | |
getAPMachHoldOn() | Out | bool | |
getAPYawDampenerOn() | Out | bool | |
getAPAutothrottleArm() | Out | bool | |
getAPTakeoffPowerOn() | Out | bool | |
getAPAutothrottleOn() | Out | bool | |
getAPVerticalHoldOn() | Out | bool | |
getAPRPMHoldOn() | Out | bool | |
getParkingBrakeIndicator() | Out | bool | |
getFuelTankCenterLevel() | Out | byte | |
getFuelTankCenter2Level() | Out | byte | |
getFuelTankCenter3Level() | Out | byte | |
getFuelTankLeftMainLevel() | Out | byte | |
getFuelTankLeftAuxLevel() | Out | byte | |
getFuelTankLeftTipLevel() | Out | byte | |
getFuelTankRightMainLevel() | Out | byte | |
getFuelTankRightAuxLevel() | Out | byte | |
getFuelTankRightTipLevel() | Out | byte | |
getFuelTankExternal1Level() | Out | byte | |
getFuelTankExternal2Level() | Out | byte | |
getFuelTankCenter() | Out | int | |
getFuelTankCenter2() | Out | int | |
getFuelTankCenter3() | Out | int | |
getFuelTankLeftMainCapacity() | Out | int | |
getFuelTankLeftAuxCapacity() | Out | int | |
getFuelTankLeftTipCapacity() | Out | int | |
getFuelTankRightMainCapacity() | Out | int | |
getFuelTankRightAuxCapacity() | Out | int | |
getFuelTankRightTipCapacity() | Out | int | |
getFuelTankExternal1Capacity() | Out | int | |
getFuelTankExternal2Capacity() | Out | int | |
getFuelTankLeftCapacity() | Out | float | |
getFuelTankRightCapacity() | Out | float | |
getFuelTankCenterQuantity() | Out | int | |
getFuelTankCenter2Quantity() | Out | int | |
getFuelTankCenter3Quantity() | Out | int | |
getFuelTankLeftMainQuantity() | Out | int | |
getFuelTankLeftAuxQuantity() | Out | int | |
getFuelTankLeftTipQuantity() | Out | int | |
getFuelTankRightMainQuantity() | Out | int | |
getFuelTankRightAuxQuantity() | Out | int | |
getFuelTankRightTipQuantity() | Out | int | |
getFuelTankExternal1Quantity() | Out | int | |
getFuelTankExternal2Quantity() | Out | int | |
getFuelTankLeftQuantity() | Out | float | |
getFuelTankRightQuantity() | Out | float | |
getFuelTankTotalQuantity() | Out | int | |
getAmbientTemperature() | Out | float | |
getAmbientPressure() | Out | int | |
getAmbientWindVelocity() | Out | float | |
getAmbientWindDirection() | Out | int | |
getAmbientPrecipRate() | Out | int | |
getAmbientPrecipState() | Out | int | |
getHeadingGyro() | Out | int | |
getHeadingMag() | Out | int | |
getHeadingTrue() | Out | int | |
getMasterWarningOn() | Out | bool | |
getMasterCautionOn() | Out | bool | |
getPlaneName() | Out | String | |
getZuluTime() | Out | String | |
getTimezoneOffset() | Out | int | |
getLocalTime() | Out | String |
Autpilot button example
The easiest setup to get you started is getting a pushbutton to interact with MFS2020. In this example, we'll explain everything you need to create your first project.
What you’ll need
- A microcontroller (Arduino, ESP, Teensy, etc.).
- A pushbutton.
- 2 Wires (preferably 1 black and 1 colored).
- A breadboard
Other components will work as well so feel free to experiment to your hearts desire
Wiring the components
There are multiple ways to connect the pushbutton to a microcontroller. We’ll teach you the easiest way, which utilizes the microcontroller's built-in pullup resistors.
First place the pushbutton in the middle of the breadboard so it bridges the gap in the middle. Now connect one of the wires to the ground connection on your controller and the other end to the top leg of the button (see the image below). The next step will be to connect the other leg of the button to pin 8 on your controller (you can change the pin as long as you alter the code as well).
Writing the firmware
We need to write a small bit of code to make the controller interact with the button. Remember to make any changes if you’ve decided to connect the button to another pin.
// This is needed when using another IDE than the Arduino IDE
#include <Arduino.h>
#include <BitsAndDroidsFlightConnector.h>
// Connect the button to pin 8
#define APBTNPIN 8
// Create a connector instance
auto connector = BitsAndDroidsFlightConnector();
// To check against if the state changed
int old_btn_state = HIGH;
void setup() {
// Start serial coms at a rate of 115200 (this can be changed later)
Serial.begin(115200);
// Enable the internal pullup resistors
pinMode(APBTNPIN, INPUT_PULLUP);
}
void loop() {
const int btn_state = digitalRead(APBTNPIN);
// To avoid unnescesary triggers
if (old_btn_state != btn_state){
if(btn_state == LOW){
// A full list of commands can be found in the inputs chapter
connector.send(sendApMasterOn);
}
old_btn_state = btn_state;
// Add a delay to debounce noise
delay(200);
}
}
Contributing
Events
In this chapter we will go over events and what to keep in mind when contributing events to the connector.
Outputs
Outputs are events that retrieve data from the simulator and get sent to your microcontroller. There are two types of outputs:
- Simconnect events
- WASM events
Simconnect events
Simconnect events are provided by Microsoft Flight Simulator. They can be subscribed to, and the simulator will send an update if the value has changed.
{
"simvar": "ADF ACTIVE FREQUENCY:1",
"metric": "Hz",
"update_every": 0,
"cb_text": "ADF 1 active",
"id": 954,
"output_type": "adf",
"category": "NAV and COMS"
},
Simvar
The event itself is declared in the same field. This field dictates which event is subscribed to in the Simconnect SDK. Most events are documented in the Simconnect SDK docs of Microsoft Flight Simulator. In practice, some events aren't appropriately documented. The ingame dev tools can provide more information on the implementation of events.
Metric
The metric value is the value format requested from the simulator. This is usually documented in the Simconnect docs, but it's possible to experiment with different values that aren't documented. For example, events that accept Hz might also accept Khz and Mhz as metric values.
Update rate / Epsilon
The interval at which these events are transmitted can be altered using the epsilon parameter (update_every). The epsilon parameter indicates at which float interval an update has to be sent. For example, when retrieving the height, you can receive an update every 0.00001 feet, 1 foot, or 10 feet. These values can be tweaked to a sensible threshold. Currently, the threshold is set by the connector. At a later point, it will be possible for users of the connector to override these values. Try to set these values at a sensible threshold for most users. For example, most people don't need to receive a heading update every millimeter. Setting the update value to either 0.5 or 1 makes more sense.
Checkbox text
The cb_text field describes the event. This is also the text that will be displayed in the bundle editor. If necessary, this field can be postfixed with a minor description. Try to use descriptors as little as possible. The target is short and to the point.
ID
The ID field is an identifier used to identify events when transmitting them to your controllers. The reserved ID range for Simconnect events is 100-1000.
Output type
Output type dictates the registration and formatting of events. Possible values are:
"adf" => Ok(OutputType::ADF),
"boolean" => Ok(OutputType::Boolean),
"integer" => Ok(OutputType::Integer),
"float" => Ok(OutputType::Float) // Retrieved as float send as is,
"float1decplaces" => Ok(OutputType::Float1DecPlaces) // Retrieved as float rounded to 1 dec place,
"float2decplaces" => Ok(OutputType::Float2DecPlaces) // Retrieved as float rounded to 2 dec places,
"seconds" => Ok(OutputType::Seconds) // Parsed to time hh:mm:ss,
"secondsaftermidnight" => Ok(OutputType::Secondsaftermidnight) // Parsed to 15:34:15 (time of day),
"percentage" => Ok(OutputType::Percentage) // Parsed to 80 for 80%,
"degrees" => Ok(OutputType::Degrees) // Retrieved as radians parsed to degrees,
"inhg" => Ok(OutputType::INHG),
"meterspersecond" => Ok(OutputType::Meterspersecond) // retrieved as mps converted to kmh,
"meterspersecondtoknots" => Ok(OutputType::MeterspersecondToKnots) // Retrieved as mps converted to knots,
"string" => Ok(OutputType::String),
The first distinction is whether the output is a string or a number. Both types have separate registration logic in the connector. The second part determined by the output type is the output format. If the value is a number, the output format is determined by the type belonging to the event. In theory, the connector receives all numbers as float values. The parsing logic can be found in the sim_utils/output_converters module.
Category
The bundle edit menu categorizes outputs based on the category provided in the category field. Custom/WASM events get their own separate category. At a later point users will be able to add their own custom categories.
WASM Outputs
Third-party developers might find that the provided Simconnect events only cover some of their needs. They can expose a deeper event layer in a gauge API that the connector hooks into through a WASM module. With Simconnect events, the Simconnect SDK tells us when a new update is available. The WASM logic flow is more complex than Simconnect events. We are in complete control of the entire data flow. We ask for the current value of the event -> store that value -> check if that value is more significant than the indicated threshold/epsilon and send it to the connector. Due to this polling mechanism, there is a slight chance we miss certain intervals of fast-changing values (but the current value will always reflect the latest and up-to-date value).
{
"id": 1000,
"action": "(L:Generic_Master_Caution_Active)",
"action_text": "Master caution on",
"action_type": "output",
"output_format": "time",
"update_every": 0.0,
"min": 0.0,
"max": 100.0,
"plane_or_category": "generic"
},
ID ranges
Please note the following text:
Custom WebAssembly (WASM) events can be provided as a base set by the connector or as custom events by users. The base set uses an ID range between 1000 and 7000, while IDs 7000 - 10000 are reserved for custom user events. This differentiation is important to prevent ID conflicts.
Certain default ID ranges have been reserved for event groups of popular aircraft. If you want to contribute to the event list, please open a pull request (PR) to edit the file with a reserved ID block.
- Flybywire: 2000-2500
- PMDG: 3000-3500
If you want to reserve a block, please update this page.
Flight Companion
Drivers
In order to use this device you need to install two pieces of software. Firstly make sure to install the device drivers. This ensures your pc can recognize and communicate with your Flight Companion.
In order to connect your Flight Companion to Microsoft Flight Simulator you need to install the Bits and Droids Flight Connector.
The latest release can be retrieved using the link above. Use the setup.exe to install the connector. Updates are being pushed through the app after installation.
This software interprets the events the controller sends and transmits the game data.
Setup the controller
To make your life easier I've made it really simple to setup your Flight Companion. On the connection page of the connector you're able to load all required settings using the add partner device option. This option can be found in the top navbar, events -> partner devices.
In the window that opens you can add the device using the add to connector button.
First run
We're almost ready to use the Flight Companion. Since you're able to use the Bits and Droids Flight Connector for more devices than your Flight Companion we need to do a minor setup. On the connection page make sure that your device is selected in the left dropdown (it should show up with Silicon Labs CP210x ... in the name). Make sure to select the Flight Companion bundle in the right dropdown.
This ensures the connector knows which data to send to your Flight Companion.
Unlock all features
Microsoft Flight Simulator uses multiple layers of actions. In order to unlock all features we need to install a plugin to utilize features like the pfd controls. This can be done with a single click of a button. From the connection page (the homepage) go to the top navbar -> settings -> install wasm. A popup should appear asking for the location of your community folder.
The default location for this folder is:
Steam
C:\Users\{USERNAME}\AppData\Roaming\Microsoft Flight Simulator\Packages\Community
Microsoft Store
C:\Users\{USERNAME}\AppData\Local\Packages\Microsoft.FlightSimulator_8wekyb3d8bbwe\LocalCache\Packages\Community
MFS 2024
%appdata%\Microsoft Flight Simulator 2024
Click confirm after selecting the community folder.
After this we are able to start our simulator and hit the green start button in the connector.
Automatically start the connector
Having to start the connector everytime you launch Microsoft Flight Simulator can be a hassle. If you want the connector to Automatically launch and start you can enable the auto launch setting. From the connection page (the home page) -> go to the top navbar -> settings -> connection settings. In this window you can enable launch when sim starts.
Controls
There are currently four modes available on your flight companion. The controls change depending on the current active mode. To Change the current mode rotate the lower encoder.
Radio
The radio mode let's you interact with the comms and ATC.
Control | Action |
---|---|
Upper outer encoder | Increase/decrease Khz frequency |
Upper inner encoder | Increase/decrease Mhz frequency |
Upper encoder push | Swap frequencies |
Lower encoder push | Swap radio mode (com1/com2/nav1/nav2) |
Touchscreen | Buttons 0-9 to communicate with ATC |
Autopilot
Control | Action |
---|---|
Upper outer encoder | Select target ap value (alt/hdg/vs) |
Upper inner encoder | Increase/decrease target ap value |
Upper encoder push | Enable ap target mode (alt/hdg/vs) |
Lower encoder push | INOP. |
Touchscreen | Enable/disable AP |
PFD Controls
Control | Action |
---|---|
Upper outer encoder | Navigate menu items when window is open (i.e. G1000 dir window) |
Upper inner encoder | Change values when window is open (i.e. G1000 dir window) |
Upper encoder push | Enable ap target mode (alt/hdg/vs) |
Lower encoder push | INOP. |
Touchscreen | Menu btn, Flightplan btn, zoom in, zoom out, procedure btn, dir btn, clear btn, pfd softkeys 1-12 |