Closed maropboia closed 1 month ago
This project is not being worked on at the moment. Either way, GitHub issues page is not the way to contribute. You can freely fork the project and add support to your desired boards.
I'm not sure it will work or not so i shared here. + u need to edit main code
Esp32 is powerful please add support #include
include
include
BLEHIDDevice hid; BLECharacteristic input;
int x = 0; int y = 0; String cmd = ""; char symbols[] = "-,0123456789"; char code[] = "UNIBOTCYPHER"; bool encrypt = false;
void decryptCommand(String &command) { if (encrypt) { for (int i = 0; i < command.length(); i++) { for (int j = 0; j < sizeof(code) - 1; j++) { if (command[i] == code[j]) { command[i] = symbols[j]; break; } } } } }
void setup() { BLEDevice::init("ESP32 Mouse"); hid = new BLEHIDDevice(); input = hid->inputReport(1); hid->manufacturer()->setValue("Manufacturer"); hid->pnp(0x02, 0xe502, 0xa111, 0x0210); hid->hidInfo(0x00, 0x01); hid->reportMap((uint8_t*)HID_REPORT_MAP, sizeof(HID_REPORT_MAP)); hid->startServices();
Serial.begin(115200); Serial.setTimeout(1); }
void loop() { String cmd = Serial.readStringUntil('\r');
if (cmd.length() > 0) { if (cmd[0] == 'M') { decryptCommand(cmd); int commaIndex = cmd.indexOf(','); if (commaIndex != -1) { x = cmd.substring(1, commaIndex).toInt(); y = cmd.substring(commaIndex + 1).toInt();
} }