//This example code is in the Public Domain (or CC0 licensed, at your option.) //By Evandro Copercini - 2018 // //This example creates a bridge between Serial and Classical Bluetooth (SPP) //and also demonstrate that SerialBT have the same functionalities of a normal Serial #include "BluetoothSerial.h" #if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED) #error Bluetooth is not enabled! Please run `make menuconfig` to and enable it #endif BluetoothSerial SerialBT; char Incoming_value = 0; void setup() {   Serial.begin(115200);   SerialBT.begin("ESP32test"); //Bluetooth device name   Serial.println("The device started, now you can pair it with bluetooth!");   pinMode(18, OUTPUT);   } void loop() {   if (Serial.available()> 0)   {     Incoming_value = Serial.read();           Serial.print(Incoming_value);             Serial.print("\n");             if(Incoming_value == '1')                   digitalWrite(18, HIGH);       else if(Incoming_value == '0')             digitalWrite(18, LOW);     }   }