int led=22;
int entrada;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
pinMode(led, OUTPUT);
}
void loop() {
if (Serial.available()>0)
{
entrada=Serial.read();
if (entrada =='3')
{
Serial.println("LED ENCENDIDO");
digitalWrite(led, HIGH);
delay(100);
}
if (entrada =='7')
{
Serial.println("LED APAGADO");
digitalWrite(led, LOW);
delay(100);
}
}
}