cancel
Showing results for 
Search instead for 
Did you mean: 

ESP32-BLE signal to Oculus

kaled.tekaya
Explorer

Hello everyone, I am trying to send Comand from my ESP32 to my Oculus Quest 1/2.

I found 3 libraries (ESP32-BLE-Keyboard/ESP32-BLE-Mouse and ESP32-BLE-Gamepad) in Arduino, with which I can program the ESP32 and communicate with Android devices without drivers. i used the Mouse library  And it worked with my Android phone. But not 100% in Oculus. the Oculus can find my devise and connect to it but when I press the button sometimes something happens and sometimes it doesn't. Do you have an idea how I can optimize this? and is it possible to configure the button in oculus quest?

 

this is the Arduino code:

 

#include <BleMouse.h>
BleMouse bleMouse;

const int buttonPin = 23;
boolean oldPinState = LOW;

void setup() {
Serial.begin(115200);
Serial.println("Starting BLE work!");
bleMouse.begin();
pinMode(buttonPin, INPUT_PULLDOWN);
}

void loop() {
if(bleMouse.isConnected()) {
if (digitalRead(buttonPin) == HIGH){
if (oldPinState == LOW){
bleMouse.click();
}
oldPinState = HIGH;
} else{
oldPinState = LOW;
}
}
delay(50);
}

0 REPLIES 0