Serial arduino to terminal blynk

Not according to the code you show.

Change these commands to the alternative (changing vPin to the virtual pin you have set for each LED)…

led1.off();

to…

Blynk.virtualWrite(vPin, 0); // Turn LED1 OFF

and…

led1.on();

to…

Blynk.virtualWrite(vPin, 255); // Turn LED1 ON full intensity

And so on for your 2nd LED as well

As you should see… just like with the Terminal… most every widget can be controlled with the basic Blynk.virtualWrite() command

1 Like

Sorry but I did not understand your instructions Do not go I think I have done other messes, to me the impression that I miss the comparison of the string

//----------
WidgetTerminal terminal(V1);
WidgetLED led1(V1);
WidgetLED led2(V1);
//.........................
String content = "";
char character;
BlynkTimer timer;
//...............

//................
BLYNK_WRITE(V2)
{
  int pinValue = param.asInt();
  if (pinValue == HIGH) {
    Blynk.virtualWrite(V0, "clr");
    Blynk.virtualWrite(V1, LOW);
    led1.off();
    led2.off();
  }
}
//............
BLYNK_WRITE(V1)
{
 // int pin = param.asInt();
 // if (pin == HIGH) {
    Blynk.virtualWrite(V1, 255);
  
    led1.on();
    
  //}
}
//............
void setup()
{

  // Debug console
  Serial.begin(9600);
  //SwSerial.begin(115200);
  //EspSerial.begin(115200);
  Blynk.begin(auth, ssid, pass);
  // ----------------------------
  timer.setInterval(10L, SerialInput);  // Run every 100ms
  Blynk.virtualWrite(V0, "clr");  // Clear the terminal from past info.
  //----------------------------------

  // timer.setInterval(500, Sent_serial);//Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8080);
}
void SerialInput() {
  //.................


  //.....................
  if (Serial.available()) {  // Guarda sulla seriali se ci sono dati in arrivo
    character = Serial.read();  // Leggi il carattere seriale

    content.concat(character);  // Aggiungi carattere a stringere String
    if (character == '\n') { // Carattere speciale che indica fine riga
      Blynk.virtualWrite(V0, content);  // invia una stringa al terminale

      // content = "";  // Clear holding String
       //Serial.print(content);
      //________________

      if (content == "Cucina")

      {
        Serial.print(content);
        Blynk.virtualWrite(V1, 255);
        led1.on();
      }
      else{
        led1.off();
      }
//----------------------
if (content == "Luci1")

      {
        Serial.print(content);
        Blynk.virtualWrite(V1,255);
        led2.on();
      }
      else{
        led2.off();
      }
//----------------------
content = "";  // Clear holding String

    }
  }
  Serial.flush();//svuoto il buffer
}

void loop()
{
  Blynk.run();
  timer.run();
}

In this instruction I can not get any print on the monitor so I figure out that the if statement does not occur


      if (content == "Cucina")// this instruction

      {
        Serial.print(content);
        Blynk.virtualWrite(V1, 255);
        led1.on();
      }

Sorry but for every led I have to use a different pinvirtual or I can always refer to the same pin.
Type of led1 pin v1 led2 pinv1 or Example led1 pin V1 led2 pinV2 and so on

woww… thats cool…
but i have any problem…
in scope i find new problem,
so what the problem in this scope…
#define DEBUG_BSSL(fmt, …) DEBUG_ESP_PORT.printf_P((PGM_P)PSTR( “BSSL:” fmt), ## VA_ARGS)
^
C:\Users\andre\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\libraries\ESP8266WiFi\src\CertStoreBearSSL.cpp:56:5: note: in expansion of macro ‘DEBUG_BSSL’
DEBUG_BSSL(“CertStore::_preprocessCert: OOM\n”);
^
C:\Users\andre\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\libraries\ESP8266WiFi\src\CertStoreBearSSL.cpp: In static member function ‘static const br_x509_trust_anchor* BearSSL::CertStore::findHashedTA(void*, void*, size_t)’:
C:\Users\andre\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\libraries\ESP8266WiFi\src\CertStoreBearSSL.cpp:25:31: error: ‘DEBUG_ESP_PORT’ was not declared in this scope
#define DEBUG_BSSL(fmt, …) DEBUG_ESP_PORT.printf_P((PGM_P)PSTR( “BSSL:” fmt), ## VA_ARGS)
^
C:\Users\andre\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\libraries\ESP8266WiFi\src\CertStoreBearSSL.cpp:208:9: note: in expansion of macro ‘DEBUG_BSSL’
DEBUG_BSSL(“CertStore::findHashedTA: OOM\n”);
^
exit status 1
Error compiling for board NodeMCU 1.0 (ESP-12E Module).