Skip to content

Instantly share code, notes, and snippets.

Created March 19, 2021 18:26
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Simple BluetoothSerial to Serial Communication in ESP32.
#include "BluetoothSerial.h"
/* Check if Bluetooth configurations are enabled in the SDK */
/* If not, then you have to recompile the SDK */
#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it
BluetoothSerial SerialBT;
void setup() {
/* If no name is given, default 'ESP32' is applied */
/* If you want to give your own name to ESP32 Bluetooth device, then */
/* specify the name as an argument SerialBT.begin("myESP32Bluetooth"); */
Serial.println("Bluetooth Started! Ready to pair...");
void loop() {
if (Serial.available())
if (SerialBT.available())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment