Turn on LED with Bluetooth

char Incoming_value = 0;                //Variable for storing Incoming_value
void setup()  
{
  Serial.begin(9600);         //Sets the data rate in bits per second (baud) for serial data transmission
  pinMode(13, OUTPUT);        //Sets digital pin 13 as output pin
}

void loop()
{
  if(Serial.available() > 0)  
  {
    Incoming_value = Serial.read();      //Read the incoming data and store it into variable Incoming_value
    Serial.print(Incoming_value);        //Print Value of Incoming_value in Serial monitor
    Serial.print("\n");        //New line 
    if(Incoming_value == '1')            //Checks whether value of Incoming_value is equal to 1 
      digitalWrite(13, HIGH);  //If value is 1 then LED turns ON
    else if(Incoming_value == '0')       //Checks whether value of Incoming_value is equal to 0
      digitalWrite(13, LOW);   //If value is 0 then LED turns OFF
  }                            
}         `Preformatted text`


Screenshot 2021-05-31 20.19.42
The Bluetooth is connected to the phone I try to press on and off there is a blink on X1 slightly but the LED doesn't turn on

which Bluetooth ? how is it connected to the Arduino ? which Arduino ? what does Serial.print(Incoming_value); //Print Value of Incoming_value in Serial monitor show (and where) when you get something ?

Hello, do yourself a favour and please read How to get the best out of this forum and modify your post accordingly.

Bluetooth HC-05 sir, sorry im new those Incoming_value comes from the rx/tx signyal sent

which 1 or 0 based on the MIT app

answer those

the led on pin 13 with gnd

Try using software serial for the bluetooth connection. Then you can use Serial for debugging and see what you're getting (if anything).

wire D10 to RX on HC-05 and D11 to TX on HC-05, open the Serial Monitor at 115200 bauds and upload this code:

#include <SoftwareSerial.h>
#define txPin 10 // D10 will be Arduino's TX, connect to RX on HC-05
#define rxPin 11 // D11 will be Arduino's RX, connect to TX on HC-05
SoftwareSerial hc05(rxPin, txPin);

void setup()
{
  Serial.begin(115200);
  hc05.begin(38400);
}

void loop() {
  if (hc05.available()) {
    uint8_t r = hc05.read();
    Serial.write(r);
    Serial.print(F("\t"));
    Serial.println(r, HEX);
  }
}

what do you see when you play with the buttons in your phone app?

Serial test still doesnt show anything, but when I click previously led x1 blink, right now doesn't blink

my bad right now rx led is blink

ok look like the serial is work now

look like the value is x and ? what does it mean?

I don't know what you are referring to. Please be more precise and document your asks.

the serial test value in the com port shows value of (?) and (x)

could you share a screen grab of the Serial monitor after typing a few times on the various buttons on the phone? ensure the Serial Monitor is configured at 115200 bauds.

Is your BT module properly configured at 9600 bauds?

im not really sure i just bought the one online HC-05

#include <SoftwareSerial.h>
#define rxPin 8
#define txPin 7

SoftwareSerial mySerial(rxPin, txPin); // RX, TX
char myChar ; 

void setup() {
  Serial.begin(9600);   
  Serial.println("Goodnight moon!");

  mySerial.begin(9600);
  mySerial.println("Hello, world?");
  pinMode(13, OUTPUT);
}

void loop(){
  while(mySerial.available()){
    myChar = mySerial.read();
    Serial.print(myChar);
  }

  while(Serial.available()){
   myChar = Serial.read();
   mySerial.print(myChar);
  }
  
}

ok look like this code is work, thanks all