I am pretty sure. In any event if I was attempting to load a second joystick test Arduino rejects it. I will delete all the sketch library and start again. Having said that I did read on a forum but new versions of Arduino are not always backwards compatible. I have the latest version.
Like you are don't understand why it's rejected. Perhaps you could give me the specific code that will allow the Leonardo to interface with the Joystick.
As I think I said it shows up in control panel then in Windows test program but the encoder has no effect.
Delete all traces of Joystick and tried to compile the sketch but it highlighted missing Joystick.h. So I uploaded the correct Joystick Zip. Tried to compile and got:
Your code is missing something; you haven't copied everything from wherever you got that code.
Looks like you're missing Joystick_ Joystick(0x15, JOYSTICK_TYPE_GAMEPAD,.
Instead of working on your project, first look at and try some of the examples that came with the Joystick library that you installed.
Note:
Don't post screenshots of code and don't post screenshots of errors. There is that beautiful 'copy error messages` button on your screen, specifically for those errors.
The example gamepad sketch that comes with the library worked for me it gave d pad and 1 fire button. I modded the sketch for more buttons then the guy a few posts up made it into an array. Ahhh
Make sure you use the sketch with the array since that will work with both the leonardo and the pro micro.
I stripped everything out and started again. I can get a gamepad showing in Windows using the Joystick Test. As soon I uploaded the basic project yours is based and with Joystick.h loaded it compiles and loads but then no Gamepad in Windows. Could this be a problem with having the latest version of Arduino. I read somewhere the versions are not backwards compatible.
This started because I couldn't get another code to work. I could see it in control panel/ then windows test software and even saw it in my flight sim calibrator but the encoder worked in Serial Monitor but not in the sim.
That is odd. Its working here iv implemented it in to my arcade cab. I used latest arduino ide to do this in.
I have put a full bundle of this up on arcadecontrol forum. Zip file is there with schematic sketches and board id etc.
Do you have a link to actual position on on that forum. Incidentally I came across the attached code which does work after a fashion. It acts almost like a motorised trim rather than a simple Scroll Up Scroll Down action. You have to gone one click back or forward to stop the rotation.
I found it and down loaded gamepad 2 and my trim worked on 1&2 with the same scrolling effect as described. Is it possible to make it so it is increment, as in I click forward or make rather scrolling then stopping it.
in trying to understand this joystick codes behavior, how does it work when sending button states over usb? does it read the pins wait for the 10ms delay then send? or does it read pins, send button states over usb then wait the 10ms delay and repeat again?