Pages: [1]   Go Down
Author Topic: Arduino Uno for flight simulator input  (Read 4139 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Gents,

I am new to Arduino and fairly new to electronics. But I am highly skilled in CNC machining and welding.
I am making a full scale F-16 flight simulator and need to interface mechanical devices to the PC.

I have a few questions.
1) I want to use the Uno to sense buttons as imput and send keystrokes to a flight simulator.
    The first simulator I want to interface to is Falcon4 I have all of the keystroke information needed.

2) I just noticed the new mega which has many more inputs, that might be the better choice.

3) I was reading thru a article about virtual keyboard, but now I am confused. It sounds like the
    Uno can act like a virtual keyboard without going thru those extra steps.

4) If anyone has info on how to make the uno and the new mega sense button inputs and send keystrokes to the flight sim computer would you please provide a link or any info?

Thanks in advance
« Last Edit: April 11, 2011, 10:43:41 pm by slingshot » Logged

Wellington, New Zealand
Offline Offline
Sr. Member
****
Karma: 1
Posts: 404
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Awesome project!

One way you could send key inputs to a host PC would be to program the UNO to be a Keyboard HID device.  This means that when its plugged into the host PC the UNO appears to be a USB keyboard and it can send any of the keys that a USB keyboard can send.  You can also send up to 6 simultaneous key presses (i.e. as if 6 keys are being held down).

To do this you need to flash new firmware to the atmega8u2 on the UNO using DFU mode.  You can find the Keyboard HID firmware, a demo sketch, and details on DFU flashing on my blog here: Arduino Hacking.

This is a little bit awkward because you have to flash back the Arduino-usbserial.hex firmware whenever you want to upload a new sketch, then flash back the Arduino-keyboard.hex firmware. Plus you can't use the serial monitor when the keyboard firmware is loaded, so debugging is difficult - it might pay to attach an LCD or some other output device to aid in debug.

Another option would be to use Joystick HID firmware so the UNO appears to be a joystick.  The LUFA project has demo code for a basic joystick with X and Y axis and 2 buttons, so it would be easy to create firmware based on that, but I would imagine that you'd want more analog inputs than just X and Y and a lot more button inputs (e.g. 6 to 8 analog inputs and 20 - 30 buttons).  That requires a bit more effort to develop but I think I'll give it a go in a couple of weeks time.
« Last Edit: April 12, 2011, 05:34:49 am by dhunt » Logged


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

Thanks for your response!
I actually have your web/blog site bookmarked.
I will have to look thru it at greater detail.

So if you do not want to have to keep flashing the uno do you need to build a virtual keyboard
like I have seen in some of the books?
Logged

Wellington, New Zealand
Offline Offline
Sr. Member
****
Karma: 1
Posts: 404
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I haven't tried this but you might be able to create a solution as you've suggested.  I took a quick look at Practical Arduino Virtual USB Keyboard and it looks like you could do a keyboard or joystick interface that way.
Logged


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

Thanks for your response.

I have been looking at the specs for the new mega.
Is it setup to communicate with a PC after a sketch has been uploaded?
It looks like it has 2 usb ports. I assume 1 for flashing the chip and the other for
attaching to the pc to make it a usb device.
 
I am wondering if it would be the better board to use for this project.
If so I will buy some when they are available again.

I am still going to play around with the Uno and figure out how to use it.
That way I will not be asking as many Noob questions (I hope)
Logged

New Zealand
Offline Offline
Newbie
*
Karma: 0
Posts: 1
A man on a mission.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Guys,,  Newbie here but here goes..

I have been ploding away at software for interfacing Arduino cards to other programs (mainly flight sim) and a wee while ago released a "starter" program for sending outputs from FSX. (LED's, meters etc)

I got badgered from my mates to make an Input card program and went the whole hog,,  only wanted to do it once,,  and produced an "interfacing" program that will take inputs from the card and send them to FSX or FS2004 ,,, well its actually better than that ,,, it will send keystrokes to just about any program that you nominate whether its in focus or not.

The inputs card program is not released yet but I thought I would throw this in here to let you know there is light on the horizon.

Keep your eye on my website.

I'm having a ball with these cards ,,,  amazing wee things.

Aaahh  back to it ,,,  cheers ,,,  Jim

My site ,,,
www.jimspage.co.nz

« Last Edit: April 16, 2011, 06:30:35 pm by JimNZ » Logged

Flight sim for ever. !!!
www.jimspage.co.nz

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

i has looking you site JIM,but no understand how i add trimm wheel to arduino and arduino to pc and pc to fs2004 smiley-grin
use i keyboard simulator add trimm wheel to fs2004 ? need i new board leonardo have usb connection ready.
or what is best way ?
you arduino nboard and many swithes have good must test someday then have time. mean "starter2.pde" have ready to use flight sim many switch ?
Logged

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

Hello Jim, I test my switches whit arduino uno and "starter2.pde" but serial monitor show all swithes i bush ok,come D021,020 etc, its ok at switch-arduino-pc ?
but how i connect switch to fs2004 ?
i try manytime config links2fs program G=gear and switches same at key program section, all ok. but how gear sno show at fs2004 plane panel ?
i fly whit cessna 172 and mooney plane.
i use mooney and switch gear up/down at screen whit mouse but no leds light no high/down.
and i use switch at arduino board bush gear up/down no working, screen panel no move gear bush button,light no go ON,

working only i write serial monitor about 100G = gear up (hmmm? has G300 maybe)button and value?
etc. light shut or on.why no working whit panel and computer screen ?
sorry i no know how i tell my proplem smiley-sad
i interesting lot thats arduino system but how can working good, if working can make radio panel,swithes,hud,encored many my flight sim 2004 .but how.i no understand good thats now i sorry smiley-sad

Logged

Pages: [1]   Go Up
Jump to: