T-vK / ESP32-BLE-Keyboard

Bluetooth LE Keyboard library for the ESP32 (Arduino IDE compatible)
2.28k stars 379 forks source link

setDelay() and USE_NIMBLE #211

Open alexz006 opened 1 year ago

alexz006 commented 1 year ago

setDelay() only works if NIMBLE is used.

/*
  Tests setDelay() if

  #define USE_NIMBLE
  and
  // #define USE_NIMBLE

  in BleKeyboard.h
*/

#include <BleKeyboard.h>

BleKeyboard bleKeyboard;

void setup() {
  Serial.begin(115200);

  bleKeyboard.setDelay(100); // works only #if defined(USE_NIMBLE)

  bleKeyboard.begin();

  while (!bleKeyboard.isConnected()) {
    Serial.print(".");
    delay(250);
  } Serial.println();

  delay(5000);
}

void loop() {
  while (!bleKeyboard.isConnected()) {
    Serial.print(".");
    delay(250);
  }

  // TEST setDelay()
  bleKeyboard.print("Hello World! ");

}