-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues and Feature requests #259
Comments
Thanks @DrSimgear for the report. Some suggestions to make tracking and offering assistants easier, would be break your issue up into small, clear issues, each of there own. You could link them in the description or comments if they are related. Just makes things little easier for everybody. Also providing a link to your code or snippets showing the problem would take a lot of guess work out for people wanting to help. First issue: Second issue:
Third:
This just compiles, I have not tested further. Let us know how it does. |
Hi, Thanks for the reply @LeeNX . I made a pr, let me know if it's good to go. Sorry I shouldn't have combined multiple issues, I didn't want to add spam too much. For the third issue, I will give the code a try on the weekend. I think I will need to add the advertising part to it too because I want windows to reconnect back when I unplug usb. Second issue: https://github.com/DrSimgear/OH58-Kiowa-Collective |
Setting axes should now be fixed in https://github.com/lemmingDev/ESP32-BLE-Gamepad/releases/tag/v0.6.6 |
@lemmingDev I updated to newest version and flashed same firmware but axis output from ble is stuck at 0. It is sending button states though and I can see axis position change in serial monitor. |
ooh - should've tested myself - I see no axes are working now after the recent release I've just tested myself, and there didn't seem to be any issues in the first place in all of the built-in examples for my library before I updated it trying to fix an issue (that perhaps doesn't exist?) I'll release a new version reverting back to the way it was and then might check your controller code for issues Thanks |
Here is an updated driving controller test sketch where you can set the axes min to either a zero or negative value, and it works perfectly across the entire range I cannot find any issue whatsoever Please test and confirm the same with updated v0.6.8 release
|
Oh, and don't use anything over 0x7FFF / 32767 in the axes max, as over that goes into negatives values when you assign them to the USB HID descriptor It's standard int16_t behaviour Eg,
gives you
|
Your 65535 is actually 0xFFFF which is -1
gives you
|
I just checked that Joystick_ESP32S2 library you referenced You should be able to set the 2 lines in Joystick_ESP32S2.cpp from
to
and then use 32767 as the max and 0 as the min when setting up my library, and then both libraries should be able to coexist fine in your sketch I don't think there's a need to modify this library to accept max axis values larger than the max int16_t value of 32767 as even that is overkill for any kind of game controller IMO 0 to 32767 gives 15 bits and -32768 to 32767 gives 16 bits of resolution. I'm not aware of any consumer grade input device that could accurately give that resolution |
There is this #include <driver/adc.h> in
ESP32-BLE-Gamepad/BleGamepad.cpp
Line 7 in d43027a
picture
I'm not sure why its there but I was getting this warning so I removed it and warning went away.
Second Issue;
Throttle axis is int16 but it should be uint16. When I set 65535 and 0 as max min, it doesn't really work the way I intend since the max is 32767. I also use the Joystick_ESP32S2 library in combination with it for usb gamepad so I switch between usb and ble on the fly. On that using 65535 and 0 works perfectly well but if I connect through ble then the numbers go into negative because anything above 32767 loops around to -32767. Throttle shouldn't need to go into negative, there is no games that need negative throttle values afaik
Third;
I would like to be able to disconnect clients and start/stop advertising ble. There is functions in nimble arduino library to do this but I couldn't figure it out how to add them to my arduino program because I couldn't get the syntax right. First I tried to turn off ble all together but when I turned it back on I would get overflow because there is a procedure you have to follow to turn off ble properly, someone posted how for esp idf but I couldn't get the syntax right for it in arduino ide. Basically I would like for esp32 ble connection to cut out when I plug in the usb into a computer at which point the usb gamepad takes over or vice versa, since they look like the same device with the same vid and pid, etc. games start getting inputs from the usb without having to rebind etc.
The text was updated successfully, but these errors were encountered: