How to connect external controls?

Until now I have just used default controls (yoke, throttle quadrant, …) and I want to understand how you connect custom things (switches, buttons, LEDs, …) and use them with MSFS. It would be nice to get the big picture.

What I know:
There is a SimConnect API (is this a DLL? A web API?) and you can do “something” with it. What exactly? Is SimConnect the one and only way to connect external things or are there more options?

There is FSUIPC, which connects to SimConnect(?) and then does … I don’t know. I’ve seen people use their normal input devices via FSUIPC, but whats the advantage in contrast to the MSFS input configuration?

Do I need an Arduino in order to use custom buttons / lights? Or are there more options? How do I start? What are the limits? For example, could I theoretically build a home cockpit with 200 buttons and switches and connect them through one Arduino? Or what would you need to scale?

What can you do with custom inputs? Do you build custom input devices and map them using the normal MSFS input config? Or is it possible to assign them to switches of the aircraft which don’t have key mappings (for example, the overhead buttons of the A32nx or MCDU buttons)?

Is there any good beginner documentation which starts at zero and doesn’t expect prior knowledge?

1 Like

Hi - have you checked out MobiFlight or Bits and Droids yet?

MobiFlight is an Open Source platform that allows to build your home cockpit by configuration - without the need of programming.

Bits and Droids is a set of libraries if you are interested in coding your own sketch.

1 Like

A good place to start looking for hardware inspiration that is also easy for beginners is LeoBodnar.

There are quite a few off the shelf components that you can put together into functional usb controllers with not too much knowledge and could serve as a nice introduction to building your own more complex devices.

1 Like

I’ve been waiting for Simvim to come across to FS2020 but am losing hope.

HI MObiFlight,

I like the look of bits and droids but going to the website, it doesnt even expolain what it is or how to get started… Am I missing something?
Thanks
PaulyFSPauly

I don’t know, but have you checked the video tutorials on youtube?

And did you take a look at MobiFlight? It is very intuitive and there are tons of videos on YT too.

I’ll check that out next

Lots and lots of tutorials on YouTube. There has to be over 100 “how to videos” on this subject. FWIW

Propwash has DIY panels. They are nice facsimiles of GA panels.

Basically, when FS2020 is running, you can have a windows application such as Bits and Droids connect to FS2020 using the SimConnect API. This allows Bits and Droids for example to receive data on Simulation variables (i.e. Nav1 Frequency, Altitude, Speed, etc) and allows Bits and Droids to set Simulation events (Increase Nav1 Frequency, set Transponder values, Turn on autopilot, etc).

All your buttons and switches and LED displays are connected to an arduino which is connected via USB to your PC and talks to your PC by serial port. So Bits and Droids app listens for these serial port commands that you send from your arduino, and performs the action associated with those commands.

I just released a similar Sim Connector Application. More like Bits and Droids.

Cheers,
Chris

In reply to :

"So, you basically have rewritten the BAD library and connector? "

I did not rewrite the BAD library and connector. However, the BAD library could be easily emulated because the connector functions are just wrappers to a generic method. For example:

float connectorTX.sendAPHeadingHold(){
               return simevent(AP_PANEL_HEADING_ON); 
}
 float connectorTX.sendHeadingBugDec(){
              return simevent(HEADING_BUG_DEC);
}
 float connectorRX.getFeetAboveGround(){
               return simrequest(PLANE_ALT_ABOVE_GROUND);
}
float connectorRX.getApHeadingLock(){
                return simrequest(AUTOPILOT_HEADING_LOCK_DIR)
}

It becomes a simple matter to write a connector class and simply populate it with the above methods. Here is a quick pseudo code. Haven’t tested it yet.

    class BitsAndDroidsFlightConnector {
    public:
          HardwareSerial* serial;
     
      #ifndef ARDUINO_SAM_DUE
      BitsAndDroidsFlightConnector(
              bool isLeonardoMicro, HardwareSerial* serial) {
              this->serial = serial;
              if (isLeonardoMicro) {
              serial->begin(115200);
              serial->setTimeout(50);
      }
      }


       float sendAPHeadingHold(){
               return simevent(AP_PANEL_HEADING_ON); 
       }
       float sendHeadingBugDec(){
               return simevent(HEADING_BUG_DEC);
      }
       float getFeetAboveGround(){
               return simrequest(PLANE_ALT_ABOVE_GROUND);
     }
       float getApHeadingLock(){
                return simrequest(AUTOPILOT_HEADING_LOCK_DIR)
     }

  };

This transfers control to you because you can decide which functions you want. You wouldn’t have to wait for BAD to release updates with more connector functionalities. All the Simvars that return a DWORD are immediately available to you. Just write them in the configuration file. All SimEvents are immediatel available to you, even the ones that require a parameter as long as the parameter is just a number. I believe it can take structs as well but the function for that takes a void pointer and a size of data type. However I haven’t fully tested that though I have code that supports that.

I am crossposting this reply as others might be interested.
Chris