Using Arduino Mega as a Joystick

I'm currently developing a project that consists in creating a racing gaming kit (steering wheel and pedals) with an arduino Mega 2560. I did downloaded the UnoJoy-Master files and I got it working on a arduino Uno. Altought, as I need more input entrances I changed to the Arduino Mega.
The normal "turning into joystick" procedure works fine for the Uno, however, when I try to the same in Mega it does not work. I upload the code given in the file, I short the pins but then when I run the .bat file it says that the "Could not open USB device".
How can I correct this problem?

image

Arduino Mega hasn't a hardware USB support and can't be a HID device, required for joystick.
The same for Arduino Uno.

I'm sorry, I think I'm not getting there, what do you mean? I do have a functional arduino Uno as a joystick using the UnoJoy library

Did you upload the code to Mega communication chip?

What does the UnoJoy library documentation say about use on other boards?

They said that the Mega is supported too...

Yes I did

They say that it does works the same

Then, you need to do some troubleshooting.

I'm kinda new to Arduino. I got the basics os hardware and software but im not pretty sure what do you mean with troubleshooting. Troubleshooting to what? The code used, the hardware...? I tested it in 2 diferent arduino Megas 2560 and non worked

If you want help from us to troubleshoot, you have to post a lot more information.

If you have authentic Uno and Mega with ATMega16U2 USB chips, then UnoJoy should work. If you have clone boards without the 16U2 (for example, CH340 is a common substitute) then UnoJoy does not work.

From the forum guide:

We need to know what Arduino board (or other brand, such as ESP32) you are using

However, I think that anyone following the instructions would have stopped at the part where they were told to connect to the 16U2 ICSP, and found that there wasn't one. :slight_smile:

Ok I'm starting from the principle that you are talking about the chip in the arduinos mega. What I can read from there is:

Atmel
ATMEGA2560
16U-TW
355E3F
18079AU

(in both)

The USB 16U2 chip is the small black square near the USB connector and the reset button.

Please re-read post #13 and consult the official Mega board documentation

When I started my project I had a problem in turning the Arduino Uno into DFU mode. This would give me the same error as with the Arduino Mega. Is it possible tham I'm not doing the correct procedure to make it to DFU mode?
Currently I'm doing so:

  • In arduino IDE I send the code to the Arduino;
    Short the pins near the cable entrance;
    And run the .bat (MegaJoy - Attack!.bat) - here the error occurs

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.