Sending byte to arduino via HC06 issue

is there anyone who can help correct these codes? :pray:

Arduino code:

#include <SoftwareSerial.h>

SoftwareSerial mySerial(14, 15);

int led1 = 8;
int led2 = 9;
int led3 = 10;

int value = 0;  //initial serial read value


void setup()

{
  Serial.begin(9600);  //this is important. the baud rate between arduino bluetooth and smartphone

  pinMode(led1, OUTPUT);

  pinMode(led2, OUTPUT);

  pinMode(led3, OUTPUT);
}

void loop() {

  while (mySerial.available())

  {  //if serial reading is available

    delay(1000);  //delay for a second, avoid overloading

    value = mySerial.read();  //value = serial value(led value)

    Serial.print(value);  //print the serial value

    Serial.println();

    if (value == 1)  //the value which corresponds the MIT appinventor 2 byte sent. change accordingly to your own value here and MIT appinventor 2 code block

    {

      digitalWrite(led1, HIGH);

      digitalWrite(led2, LOW);

      digitalWrite(led3, LOW);
    }

    if (value == 2)

    {

      digitalWrite(led1, HIGH);

      digitalWrite(led2, HIGH);

      digitalWrite(led3, LOW);
    }

    if (value == 3)

    {

      digitalWrite(led1, HIGH);

      digitalWrite(led2, HIGH);

      digitalWrite(led3, HIGH);
    }

  
  }
}

Dear @Tanja_Marianne_Slang ,
first of all in your Arduino code ( SoftwareSerial on pin 14,15 : which board are you using ?) the initialization of the SoftwarSerial is missing.
In the setup function you shall write
myserial.begin(9600); // initialize the serial line to BT
The baudrate of your HC06 is supposed to be 9600, but this is not 100% standard, sometimes some HC06 are factory set at 38400 (and rarely to 19200), so please consider to change this setting if nothing works.
On AI2 side, my hint is to start with a more simple code: instead of using the speechrecognizer, please start with a series of simple buttons (but1,but2,but3). By hitting a button you will send the related value (1,2,3). Another hint is to send text, instead of numbers, so you can send '1', '2', '3'. Of course in your Arduino code the incoming check shall be modified accordingly.
The initialization shall be
char value = ' '; // pay attention that this is not a void character but a blank (=space)
then the comparison shall be:
if (value == '1').... the same for '2' and '3'.....

Give it a look and a try.
Cheers.

EDIT: but how do you switch off he LED's ? You should add a button0 to send a '0' that wiill be interpreted by your Arduino code as
if (value == '0')
{
digitalWrite(led1, LOW);
digitalWrite(led2, LOW);
digitalWrite(led3, LOW);
}
Of course this is only a hint.... :grin: