Go Down

Topic: Arduino to control computergame (Read 1 time) previous topic - next topic


Hi. I want to use Arduino to controll Microsoft Flight Simulator X. I'm thinking to buy a bunch of toggle switches that act as on/off switches for for examle landig lights. Or if it is a way to make a input from arduino board to appear as a keystroke to the computer. I don't know much about programming so I need a program thai I just install and play.


I need a program thai I just install and play.

Arduino is not a solution that you can just take off the shelf and use - it's a tool that you can use to design and create your own solution. You don't need to be an experienced programmer to get started, but you need to be willing to learn. The sort of behaviour you're describing should be relatively simple from the Arduino's point of view and I expect the hardest part would be choosing and mounting all the switches and labels and so on. But it will need some programming, and you'll need to learn how to do it.

If this is not something that interests you then you could ask in the Gigs and Collaborations section whether anyone will do it for you, but in that case you should be prepared to pay them for their work.


An Arduino Leonard can generate keystrokes easily (it can pretend to be a keyboard), so that could be used to send appropriate commands to the simulator. Then you could wire up switches to the pins on it to send those commands when the switch is pressed. So no big technical problem there. As PeterH says, you can learn to do this yourself (and it can be fun) or convince or pay someone else to do it.
Please post technical questions on the forum, not by personal message. Thanks!

More info:


Another way, if not getting the Arduino Leonardo, is to move some part of the logic to the PC.
Then the arduino sends a command over the virtual serial port (on USB) which is picked up by another program that you've written in a language of your choice at the PC. The language need to have good libraries for working with the serial ports and pushing global keypresses.

E.g. Arduino have a switch which controls the landing gear.
The arduino regularly checks if a digital input is high or not. On the transitions from one state to the other is sends a command (Serial.println("LANDING_GEAR ACTIVATED")).
The PC program parses this (splits on space character) and has a rule for each key (LANDING_GEAR). Perhaps the landing gear in the game is controlled by a single button, then is just "presses" this button. It would do the exact same when getting the command LANDING_GEAR DEACTIVATED.

I've haven't used the Leonardo but after checking the example code for it I would recommend using that instead of the other method I described above (for other Arduinos).

Go Up