Skip to content
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

How to send an int value to ESP32 as gamepad from Python or C program #165

Open
AlEnterni opened this issue Mar 15, 2023 · 5 comments
Open

Comments

@AlEnterni
Copy link

I'd like to ask if there's a way to send an int value from a Python or C program to the ESP32, while it's working as a gamepad. Specifically, I want to know if there's a method for achieving this using the existing codebase or if I would need to modify it. Any guidance on how to accomplish this would be much appreciated.

@baohuiming
Copy link

Not sure if I understand you correctly. Maybe you need to create a Bluetooth client to communicate. You can refer to NimBLE-Arduino

@lemmingDev
Copy link
Owner

lemmingDev commented Mar 25, 2023

Try this version

It allows you to send and receive as much info as you want over a BT Classic serial connection while using the gamepad

#111 (comment)

@AlEnterni
Copy link
Author

Would I need to connect to the ESP32 twice then? One for it to work as a gamepad and another for data?
Thank you very much!

@lemmingDev
Copy link
Owner

lemmingDev commented Mar 27, 2023

You would have 2 connections
On the first connection, you would connect to the BT Classic first, and then the BLE

Next time you connect, they should both automatically connect

The BL Classic would add a serial port for sending receiving information

@LeeNX
Copy link
Contributor

LeeNX commented Nov 23, 2024

I was able to put together a small sketch that has NUS, which is basically BLE Serial, that could be used - #195 (comment)

Or you could also try a PR - #234
That adds Output Report Function, meaning you can send data from host OS to gamepad.

Would be best if the feature was general enough, that the game engine or game building library does not need customisation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants