Pages: [1]   Go Down
Author Topic: Let Arduino act as "game controller" for Train Simulator or similar  (Read 550 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello you all!I'm a newbbie with Arduino but I love it. I wonder if and how it should be possible to use Arduino to control simulation games such as MS Train Simulator or similar. This game receives commands from keys (or combination of them) from the computer keyboard. I'd like to connect to Arduino buttons and potentiometer and by using appropriate code ask Arduino to convert them into keyboard format and send to a computer Usb port (as it was a secondary keyboard or a joystick).
In commerce there are specialized "controllers" or joystick containing buttons and cursors you can use to play the game, it's enough to tell the controller configuration which keystroke emulate when pressed. My idea would be to create this controller by using Arduino a code and a custom card with buttons switches and potentiometer.
Does anybody feel it would be possible ? and in case it was, has anybody any suggestion ?

Many thanks in advance !

Best regards

Giorgio
Logged

Queens, New York
Offline Offline
Faraday Member
**
Karma: 67
Posts: 2945
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Try this code, it sends a basic command to logoff the computer, SO it may be just what you need to get started. you may need to read the .txt to see what keys you can press for this.

Basically when one of your buttons, pots or switches are activated, it will send the corrsponding button to the computer.

Try it write something in notepad or wordpad.

http://arduino.cc/en/Tutorial/KeyboardLogout
Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks a lot for fast reply and for suggestion! I just tried it but it seems keyboard library it works under Leonardo (as this was told me by Arduino development app) and not for Arduino Uno I own. I'll try to understand how to workaround this problem if possible.
Grazie - Giorgio
Logged

UK
Offline Offline
Shannon Member
****
Karma: 184
Posts: 11197
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I haven't done it myself, but Google turned up several descriptions of projects which have successfully done this on a UNO. The term you're looking for is "HID" (Human Input Device i.e. mouse, joystick or keyboard).
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Pages: [1]   Go Up
Jump to: