https://github.com/leonardolarranaga/esp32ble.h
Send and receive data over BLE on ESP32 using the Arduino framework.
https://github.com/leonardolarranaga/esp32ble.h
arduino-ble ble esp32 esp32-arduino esp32-platformio
Last synced: 2 months ago
JSON representation
Send and receive data over BLE on ESP32 using the Arduino framework.
- Host: GitHub
- URL: https://github.com/leonardolarranaga/esp32ble.h
- Owner: LeonardoLarranaga
- Created: 2025-03-07T04:32:20.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-03-07T05:19:48.000Z (3 months ago)
- Last Synced: 2025-03-07T05:28:23.103Z (3 months ago)
- Topics: arduino-ble, ble, esp32, esp32-arduino, esp32-platformio
- Language: C++
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ESP32BLE.h
**An ESP32 class for BLE using the Arduino framework.**A simple header file for easily setting up a Bluetooth Low Energy service for sending and receiving data with ESP32.
## Usage
Just drop the `ESP32BLE.h` file into your project.To simply setup the service:
```c++
ESP32BLE bluetooth;
void setup() {
bluetooth.setup("Example");
}
```To trigger a function upon receiving data:
```c++
ESP32BLE bluetooth;void onReceiveData(const String newValue);
void setup() {
Serial.begin(115200);
bluetooth.setup("Example", onReceiveData);
}void onReceiveData(const String newValue) {
Serial.println("Received data: " + newValue);
}
```To send data:
```c++
int i = 0;
void loop() {
i += 1;
bluetooth.send(i);
delay(1000);
}
```