#include "BluetoothSerial.h"
#include <Servo.h>
Servo myservo;
BluetoothSerial SerialBT;
const int led1 =4;
void setup()
{
SerialBT.begin("ESP32-3M");
pinMode(led1, OUTPUT);
myservo.attach(21);
}
void loop()
{
if(SerialBT.available())
{
char c = SerialBT.read();
if(c=='A')
{
myservo.write(90);
}
if(c=='a')
{
myservo.write(0);
}
}
}