3

I'm trying to use my Arduino as a joystick, but I don't know how to set it as a joystick. I have an idea which is reading data from Arduino with Python and simulating the joystick. How can I implement a virtual joystick using Python? Is there another way?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
fran
  • 515
  • 2
  • 11
  • 22

2 Answers2

2

Which flavor Arduino?

First, you need an Uno model, see: http://arduino.cc/blog/2010/09/24/dinner-is-ready/

We replaced the aging FTDI chipset with a custom made usb-serial converter built with an Atmel ATmega8U2 this provides lower latency and doesn’t require to install any drivers on mac and linux (on windows all you need is a simple .inf file) more advanced users will be able to reprogram the USB chip to make the board show up as a variety of USB devices (Keyboards, Mice, Joysticks, MIDI etc)

Older models could only show up as serial ports (through the FTDI chipset).

Next, there's an article which shows how to emulate a joystick on the Uno (you will need to register on the Arduino forums to see the examples). See: http://arduino.cc/blog/2010/10/24/arduino-uno-as-joystick/

Note: you will have to replace the Arduino firmware.

payne
  • 13,833
  • 5
  • 42
  • 49
  • Thank you for the answer payne! I' ve already found that article but I don't want to mess up my lovely arduino because I'm working on another project. It would be fantastic if there was a way emulating the joystick with python.. – fran Mar 01 '11 at 00:54
  • I know this is an old post, but I figure I'll try anyway - the forum post that details that method seems to have fallen off the internet - anyone happen to have a copy of it? – camperdave Apr 07 '11 at 20:09
1

It is a very old answer but i found a library that emulate a keyboard,is not same as joystick but if you use only digital button is good,I use only serial comunication through arduino and python. I send a word through the serial to pc and python convert it in a keyboard key. I wish there is a library that could emulate a joystick with axis.

Here is the library: https://github.com/SavinaRoja/PyUserInput

Blutz
  • 11
  • 1