#include "BluetoothSerial.h"
BluetoothSerial SerialBT;
void setup() {
// put your setup code here, to run once:
SerialBT.begin("ESP32");
pinMode(5, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
char a;
if(SerialBT.available()){
a = SerialBT.read();
if (a =='1'){digitalWrite(5, HIGH);}
else if(a == '0'){digitalWrite(5, LOW);}
}
delay(20);
}