Using HID-Projects Gamepad. Windows 11 device properties window does not recognize Gamepad.press() commands. Using a pro Micro. Checked instructions over and over. Same instructions in a different sketch operating fine on a Leonardo.
Show us the code.
Hi Fernando. As a test program it doesnt get much simpler. I have a large sketch with full joystick and 20 switches working on a Leonardo but for some reason this wont work on either the Leonardo or the Pro Micro. Windows will not display switch status on the device properties window. Thanks making suggestions
#include <HID-Project.h>
#include <HID-Settings.h>
void setup() {
// put your setup code here, to run once:
Gamepad.begin();
}
void loop() {
// put your main code here, to run repeatedly:
Gamepad.press(1);
delay(500);
Gamepad.release(1);
delay(500);
}
Please edit your post to add code tags <code/>
.
How the board appears on windows device manager?
What are code tags?
In the device manager, it appears as Arduino Micro or Leonardo. In settings/properties, it displays the normal settings/test calibrate menu with bars for joystick inputs and red buttons for button states
Wayne
What are code tags?
Give me a link for instructions that you are following.
I am just using what examples I have found online. This simple program does nothing on either the Micro or Leonardo. I just tried inputting a joystick axis in as well and that does not work either.
I have all this working in another 32 button 6 axis sketch and it is all works fine. It uses exactly the same commands. Frustrating. I cannot fine why one works and the other doesn’t, specially since it is the very very basic stripped out sketch that will not work.
Wayne
It’s the one thing I hate about logic that’s not working, it’s only logical after you find the problem!
Wayne
Any thoughts on this Fernando, or anyone else? I have tied everything. Any ideas at all
Wayne
The latest:
#include <HID-Project.h>
#include <HID-Settings.h>
void setup()
{
Gamepad.begin();
}
void loop()
{
Gamepad.press(1);
}
This should just turn on Button 1
- Recompiled known good sketch which includes above text - fine
- Copied known good sketch to new name - fine
- In copied file, erased all instructions except the above sketch - didn’t work
- In the copied file, erase content, entered above sketch - didn’t work
- Opened new sketch, entered above sketch - didn’t work
Tested with both Micro and Leonardo
Totally baffled
WayneUse code tags to format code for the forum
Sorry, can’t figure out how to use the code tags
Is this better
#include <HID-Project.h>
#include <HID-Settings.h>
void setup()
{
Gamepad.begin();
}
void loop()
{
Gamepad.press(1);
}
Is there anything in the file options or preferences that would prevent the Arduino from sending Gamepad commands to Windows. I talked this problem over with a C programmer and he is baffled as well.
Ant suggestions would be greatly appreciated.
Wayne
Found the problem. I did not realize that when you do a Gamepad.press(); , it does not do it immediately, but records it along with other similar commands until you do a Gamepad.write(); where apron all are executed at one time.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.