There are obviously many ways to get switches, buttons, encoders and other cockpit hardware to talk to your simulation software. I'll show you the solutions I used for my simulator here:
To flip a switch or push a button in your cockpit and have the simulator recognize it as such, is the most easy part of hardware interfacing. Here is what you need.
Potentiometers (or pots for short) are used to input analog data. They are used when the position of a lever (e.g. flight controls) or control knob needs to be set.