Awesome
Arduino BLEPeripheral
An Arduino library for creating custom BLE peripherals with Nordic Semiconductor's nRF8001 or nR51822.
Enables you to create more customized BLE Peripheral's compared to the basic UART most other Arduino BLE libraries provide.
nRFgo Studio (and Windows) is not required when using the nRF8001.
Compatible Hardware
Nordic Semiconductor nRF8001
- Adafruit
- RedBearLab
- Femtoduino
- Olimex
- Jaycon Systems
- TinyCircuits
- TinyShield Bluetooth Low Energy - Nordic
Note: Does not require use of nRFgo Studio! However, uses more code space.
Nordic Semiconductor nRF51822
WARNING: Adafruit nRF51 boards are NOT compatible with this library, this includes the Bluefruit LE UART Friend, Bluefruit LE SPI Friend, Bluefruit LE Shield, Flora Wearable Bluefruit LE Module, Feather 32u4 Bluefruit LE, and Feather M0 Bluefruit LE.
Nordic Semiconductor nRF51 or nRF52 based boards
- Various, see arduino-nRF5 supported boards via nRF5 Arduino Add-on
Pinouts
Chip | Shield/Board | REQ Pin | RDY Pin | RST Pin |
---|---|---|---|---|
nRF8001 | ||||
Bluefruit LE | 10 | 2 | 9 | |
BLE Shield 1.x | 9 | 8 | UNUSED | |
BLE Shield 2.x | 9 | 8 | UNUSED or 4/7 via jumper | |
Blend | 9 | 8 | UNUSED or 4/5 via jumper | |
Blend Micro | 6 | 7 | UNUSED or 4 | |
IMUduino BTLE | 10 | 7 | 9 | |
TinyShield Bluetooth Low Energy | 10 | 2 | 9 | |
nRF51822 | ||||
RedBearLab nRF51822 | -1 (UNUSED) | -1 (UNUSED) | -1 (UNUSED) | |
BLE Nano | -1 (UNUSED) | -1 (UNUSED) | -1 (UNUSED) | |
RFduino | -1 (UNUSED) | -1 (UNUSED) | -1 (UNUSED) |
Compatible IDE's and MCU's
- Arduino IDE
- AVR (Uno, Lenoardo, Mega, etc.)
- SAM3X8E (Due)
- SAMD21G18A (Zero)
- Teensy (via Teensyduino)
- 2.0
- 3.0
- 3.1
- LC
Warning: For more advanced sketches an MCU with more than 2kB of RAM and 32kB of flash space is recommended. Advance sketches include:
- Multiple services and characteristics
- HID API usage
Usage
Download Library
Arduino
Using the Arduino IDE Library Manager
- Choose
Sketch
->Include Library
->Manage Libraries...
- Type
BLEPeripheral
into the search box. - Click the row to select the library.
- Click the
Install
button to install the library.
Using Git
cd ~/Documents/Arduino/libraries/
git clone https://github.com/sandeepmistry/arduino-BLEPeripheral BLEPeripheral
MPIDE
cd ~/Documents/mpide/libraries/
git clone https://github.com/sandeepmistry/arduino-BLEPeripheral BLEPeripheral
arduino-nRF5x core users
The arduino-nRF5x core REQUIRES a SoftDevice in order to successfully use this library. Please see Flashing a SoftDevice.
Further, the error fatal error: ble_gatts.h: No such file or directory
in indicitive of no SoftDevice being selected.
Starter sketch
Load starter.ino
API
See API.md.
Examples
See examples folder.
License
This libary is licensed under the MIT Licence.
Useful Links
- @lizardo's nRF8001 Experiments
- used as a starting point to reverse engineer the proprietary setup message format for the chips
- @NordicSemiconductor's ble-sdk-arduino
- Original Arduino SDK for nRF8001
- @guanix's arduino-nrf8001
- nRF8001 support for Arduino