#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 BT;
void setup() {
pinMode(22, OUTPUT);
Serial.begin(9600);
BT.begin(9600);
}
void loop() {
if(BT.available()){
char mensaje = BT.read();
if(mensaje == 'A'){
digitalWrite(22, HIGH);
Serial.println("led encendido");
}
if(mensaje == 'B'){
digitalWrite(22, LOW);
Serial.println("led apagado");
}
}
}