You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Do not set the OutputReportLength too large, otherwise it will be truncated. For example, if the hexadecimal value of 10000 in decimal is 0x2710, it will be truncated to 0x710.
23
25
24
26
bleGamepadConfig.setHidReportId(0x05); // (Optional) Set ReportID to 0x05.
25
-
//When you send data from the upper computer to ESP32, you must send the ReportID in the first byte! The default ReportID is 3.
27
+
//When you send data from the upper computer to ESP32, you must send the ReportID in the first byte! The default ReportID is 3.
26
28
27
29
bleGamepadConfig.setButtonCount(numOfButtons);
28
30
@@ -31,21 +33,28 @@ void setup() {
31
33
32
34
// Try NOT to modify VID, otherwise it may cause the host to be unable to send output reports to the device.
33
35
bleGamepadConfig.setVid(0x1234);
36
+
34
37
// You can freely set the PID
35
38
bleGamepadConfig.setPid(0x0001);
36
39
bleGamepad.begin(&bleGamepadConfig);
37
40
38
-
//changing bleGamepadConfig after the begin function has no effect, unless you call the begin function again
41
+
//Changing bleGamepadConfig after the begin function has no effect, unless you call the begin function again
39
42
}
40
43
41
-
voidloop() {
42
-
if (bleGamepad.isConnected()) {
43
-
if (bleGamepad.isOutputReceived()) {
44
+
voidloop()
45
+
{
46
+
if (bleGamepad.isConnected())
47
+
{
48
+
if (bleGamepad.isOutputReceived())
49
+
{
44
50
uint8_t* buffer = bleGamepad.getOutputBuffer();
45
51
Serial.print("Receive: ");
46
-
for (int i = 0; i < 64; i++) {
52
+
53
+
for (int i = 0; i < 64; i++)
54
+
{
47
55
Serial.printf("0x%X ",buffer[i]); // Print data from buffer
0 commit comments