#include <BluetoothSerial.h>
BluetoothSerial miBT;
const int LED_1 = 23;
char dato;
void setup() {
pinMode(LED_1,OUTPUT);
miBT.begin("BT ESP32");
}
void loop() {
if(miBT.available()){
dato = miBT.read();
if (dato == 'H'){
digitalWrite(LED_1,HIGH);
}
if (dato == 'L'){
digitalWrite(LED_1,LOW);
}
}
}