Bluetooth code not work!


Why this code not work?

#include <SoftwareSerial.h>
String readString;

SoftwareSerial mserial(10, 11);

void setup() {
  Serial.println("serial on/off test 0021"); // so I can keep track

void loop() {

  while (mserial.available()) {
    char c =;
    readString += c; 

  if (readString.length() >0) {

    if (readString == "Hello")     
      mserial.println("LED ON");
    if (readString == "off")
      mserial.println("LED OFF");


Does your BT module work at 9700 baud?

No, it work at 9600 baund. I forget change this before add this post.

Specifically, not work the command’s.

Help Me Please!

Specifically, not work the command's.

Only YOU can see what the code actually does. Only YOU can describe what you expect the code to do. Only YOU can confirm that the bluetooth device is paired with anything.

Only, you haven't done any of those things.

This is just as likely to be a matter of procedure as code. Here are some basic notes for bluetooth.