thanks for helping- bluetooth serial communication

Thanks, at last the code is working.i think somebody got angry and pushed me out from further reply.i wan’t to say it that was my mistake.hope would learn the programming so that i would eat your brains less
i would thanks all of you mr.paul s,AWOL,jml.thank you.i leant lot from you,a lot yet to come and yes,its light bulb moment :slight_smile: .

#include <SoftwareSerial.h>
SoftwareSerial BTserial(10, 11); // RX | TX
// Connect the HC-05 TX to Arduino pin 10 RX.
// Connect the HC-05 RX to Arduino pin 11 TX

void setup()
{
  Serial.begin(9600);
  Serial.println("Arduino is ready");
  BTserial.begin(9600);
  BTserial.println("Bluetooth is ready");
}

void loop()
{

  if (BTserial.available() > 0) {
    String  s = BTserial.readString();
    if ( s == "hello") {  // if the bluetooth read string is hello serially print hi
      Serial.println("hi");
    }
    else if ( s == "hey") { // if bluetooth read string is hey serially print yeah
      Serial.println("yeah");
    }
    else if (s != "hello" && s != "hey")
    {
      Serial.println("invalid"); //
    }
  }
}

Good

    else if (s != "hello" && s != "hey")

If you arrive there do you actually think there is any chance for the expression in parenthesis to be false?

no,its not required :slight_smile:

else 
    {
      Serial.println("invalid"); 
    }