nxsm | Posted: 13 Nov 2018, 03:30 PM |
---|---|
Member Posts: 6 Joined: 13-November 18 |
Greetings, I am currently developing a custom gamepad for mobile devices which consists of : 9 Buttons, x2 Analog Joysticks, Bluetooth HC05 (Flashed with RN42 firmware), Leonardo Pro Micro Arduino ATMEGA32U4 5V 16MHz. After accessing the Command mode via serial monitor, I managed to set the Bluetooth device as an HID gamepad type device and the rest of configurations. The problem is that the scans that I send via Serial1.write have a limitation for 16 buttons and 2 thumbsticks, the second thumbstick is being limited to Z and X axis. D-PAD (POV) is missing as well. What I need is a full range of available buttons like in popular Playstation or Xbox controllers. Any idea how I can do that with this module? Cheers Last edit by nxsm at 13 Nov 2018, 03:31 PM ------------- |
[top] | |
DAVID | Posted: 14 Nov 2018, 12:12 AM |
I love mcus Member Posts: 237 Joined: 10-September 17 |
Last edit by DAVID at 14 Nov 2018, 12:18 AM ------------- |
[top] | |
DAVID | Posted: 14 Nov 2018, 12:17 AM |
I love mcus Member Posts: 237 Joined: 10-September 17 |
QUOTE (nxsm)
i have test all the buttons and it supports the D-pad.D-PAD (POV) is missing as well. What I need is a full range of available buttons like in popular Playstation or Xbox controllers. could you maybe share your code? here is one that i made a while ago https://github.com/theawsomeavr/arduino-bluetooth-gamepad/blob/master/arduino_bl_gamepad/arduino_bl_gamepad.ino Last edit by DAVID at 14 Nov 2018, 12:19 AM ------------- |
[top] | |
nxsm | Posted: 14 Nov 2018, 02:29 AM |
Member Posts: 6 Joined: 13-November 18 |
Hi David, Thanks for your reply. This is the code I use to send raw HID scans from Arduino through RN-42:
And this is gamepad recognized outputs: As you can see, there are a lot of buttons and axis including D-PAD missing. I have no idea how to add them. I will test your code ASAP and see if it works. Last edit by nxsm at 14 Nov 2018, 02:46 AM ------------- |
[top] | |
DAVID | Posted: 14 Nov 2018, 02:53 AM |
I love mcus Member Posts: 237 Joined: 10-September 17 |
QUOTE (nxsm)
that is because of windows itself, you can try this website instead https://gamepadviewer.com/As you can see, there are a lot of buttons and axis including D-PAD missing. I have no idea how to add them. I will test your code ASAP and see if it works. Last edit by DAVID at 14 Nov 2018, 02:53 AM ------------- |
[top] | |
nxsm | Posted: 14 Nov 2018, 02:56 AM |
Member Posts: 6 Joined: 13-November 18 |
Just tested your code and it shows the same thing. I noticed you use different Baud rate than I do. Mine is 9600 but could that be the issue? Edit to your previous comment: I noticed that is not only windows as I tried playing games on my android and Y Rotation is not working as well as it doesn't show in windows! Thanks Last edit by nxsm at 14 Nov 2018, 02:57 AM ------------- |
[top] | |
DAVID | Posted: 14 Nov 2018, 03:02 AM |
I love mcus Member Posts: 237 Joined: 10-September 17 |
so the Y axes do not work to you? Last edit by DAVID at 14 Nov 2018, 03:03 AM ------------- |
[top] | |
nxsm | Posted: 14 Nov 2018, 03:09 AM |
Member Posts: 6 Joined: 13-November 18 |
My right thumbstick is recognized as X Rotation on X-Axis and Z on Y-Axis. The 2 available outputs you can see in my screenshot. I would like to have the Y Rotation instead mapped to my right thumbstick Y-Axis. Also, I tried the website you shared and there is no D-PAD recognition as well. What buttons and axis do work for you? Thanks again. UPDATE: Okay, I managed to add D-PAD by cheating on the number of the button I input. It appears that if I send 12,13,14,15 it recognizes this buttons as D-PAD on gamepadviewer.com but as buttons 13, 14, 15, 16 on windows gamepad properties instead. I thought it would be possible to modify it so that it would show as D-PAD(Axis type calculation). Is it even possible to use other Y, Z Rotation, Slider and Dial outputs? Last edit by nxsm at 14 Nov 2018, 04:47 AM ------------- |
[top] | |
DAVID | Posted: 14 Nov 2018, 08:23 AM |
I love mcus Member Posts: 237 Joined: 10-September 17 |
QUOTE
So you are talking about if the hc05 can show up as a d padI thought it would be possible to modify it so that it would show as D-PAD(Axis type calculation). Sorry for responding late i have been really busy doing homework Last edit by DAVID at 14 Nov 2018, 08:23 AM ------------- |
[top] | |
nxsm | Posted: 14 Nov 2018, 09:05 AM |
Member Posts: 6 Joined: 13-November 18 |
QUOTE (DAVID)
It's no problem. Thank you for finding time to help me. As I flashed the HC05 with RN42 now it behaves as an HID, and to be specific I flagged it as a gamepad. My question is: Would it be possible to access the extra Rotation axes (Rotation Y) and in general customize the descriptor report for this specific module? It is my first time working on Bluetooth HID. I know that I can modify the descriptors and send more than 16 buttons if using the USB cable. Isn't RN-42 converts the data in the same way, then why am I limited to this kind of presets? ------------- |
[top] | |
DAVID | Posted: 14 Nov 2018, 09:32 PM |
I love mcus Member Posts: 237 Joined: 10-September 17 |
sadly no, since the firmware for the rn42 is close source you can only use the 2 joysticks and 16 buttons ------------- |
[top] | |
nxsm | Posted: 15 Nov 2018, 12:04 AM |
Member Posts: 6 Joined: 13-November 18 |
QUOTE (DAVID)
sadly no, since the firmware for the rn42 is close source you can only use the 2 joysticks and 16 buttons I see. Thank you for clarifying that for me! Do you know any other BT modules with open source firmware that can allow me to do this? ------------- |
[top] | |
DAVID | Posted: 15 Nov 2018, 12:44 PM |
I love mcus Member Posts: 237 Joined: 10-September 17 |
not really, only thing that i know is about those 4.0 bluetooth modules that can even support bl midi but i am not sure if they have another axis ------------- |
[top] | |
DAVID | Posted: 15 Nov 2018, 12:46 PM |
I love mcus Member Posts: 237 Joined: 10-September 17 |
if you are on pc it would be really nice testing out the usb joystick library for the atmega32u4 and if your phone supports OTG that is something great to have Last edit by DAVID at 15 Nov 2018, 12:51 PM ------------- |
[top] | |
Sign in to post a reply.