jafal
December 10, 2022, 2:07am
5
Hi Sir
Maybe I am far about your topic
But Easy way to do it
1- If the controller connect via Bluetooth I think it’s easy to capture the key’s code as array and use it in sketch
2-You can read Bluetooth key code if you want using Serial Bluetooth Terminal App for Android
3 -for USB I found one library support USB for Android make connection with Arduino (not all kinds of Arduino) I don’t know if it’s support game controller
Here is example to receive Bluetooth
The Ketai Bluetooth Class method onBluetoothDataEvent() does not work on the latest Android modes. Also, it has no readStringUntil() method which makes it difficult to read fast incoming data. So I wrote a native Android Bluetooth code to make this possible. I tested it on a MultiLaser Lollipop 5.1 device, as well as on a Samsung Android 10, using an HC-05 module set to a baud rate of 115200, without losing a single reading byte. The first code is the simplest reading code, it will display a sin…