Datasheet

BLEHidAdafruit
BLEHidAdafruit allows you to simulate a mouse or keyboard using the HID (Human Interface Device) profile that is part
of the Bluetooth Low Energy standard.
Most modern mobile devices with Bluetooth Low Energy support, and the latest operating systems generally support
Bluetooth Low Energy mice and keyboards out of the box, once you pair your Bluefruit nRF52 Feather and run an
appropriate sketch.
API
The BLEHidAdafruit helper class has the following public API:
Example Sketches
There are a variety of example sketches showing how to use the BLEHidAdafruit class. You can browse the latest
source code on Github with the following links:
The Bluefruit nRF52 Feather codebase is in an early BETA stage and is undergoing active development
based on customer feedback and testing. As such, the class documentation here is incomplete, and you
should consult the Github repo for the latest code and API developments: https://goo.gl/LdEx62
// Constructor
BLEHidAdafruit(void);
// Call this once to start the HID service
virtual err_t begin(void);
// Keyboard
err_t keyboardReport(hid_keyboard_report_t* report);
err_t keyboardReport(uint8_t modifier, uint8_t keycode[6]);
err_t keyboardReport(uint8_t modifier, uint8_t keycode0, uint8_t keycode1=0, uint8_t keycode2=0, uint8_t keycode3=0, uint8_t keycode4=0, uint8_t keycode5=0);
err_t keyPress(char ch);
err_t keyRelease(void);
err_t keySequence(const char* str, int interal=5);
// Consumer Media Keys
err_t consumerReport(uint16_t usage_code);
err_t consumerKeyPress(uint16_t usage_code);
err_t consumerKeyRelease(void);
// Mouse
err_t mouseReport(hid_mouse_report_t* report);
err_t mouseReport(uint8_t buttons, int8_t x, int8_t y, int8_t wheel=0, int8_t pan=0);
err_t mouseButtonPress(uint8_t buttons);
err_t mouseButtonRelease(void);
err_t mouseMove(int8_t x, int8_t y);
err_t mouseScroll(int8_t scroll);
err_t mousePan(int8_t pan);
© Adafruit Industries https://learn.adafruit.com/bluefruit-nrf52-feather-learning-guide Page 142 of 175