The data from the app I send : 1 but the arduino receive : 0

smart_car_control.aia (133.6 KB)
true_bt.ino (1.8 KB)

My app is about 4wd Arduino bt car with voice speech
the data I send is used to make the car move
when I used the Bluetooth terminal app the data sent to Arduino was correct such as send 2 get 2 but when the app sends 2 receive 0 in the Arduino serial monitor
is there something wrong in the block ?

I believe you are sending byte values (0-255) from AI2 to your circuit, but your circuit is expecting text , judging by the parseInt call.

int command; // Change the data type to int

// Define the motor control pins for the L298N motor driver
const int motor1A = 13;
const int motor1B = 12;
const int motor2A = 11;
const int motor2B = 10;

void setup() {
  pinMode(motor1A, OUTPUT);
  pinMode(motor1B, OUTPUT);
  pinMode(motor2A, OUTPUT);
  pinMode(motor2B, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  if (Serial.available()) {
    command = Serial.parseInt(); // Parse the incoming integer
    Serial.println("Received command: " + String(command)); // Debug statement
    executeCommand(command);
  }
}

void executeCommand(int cmd) {
  if (cmd == 1 || cmd == 10) {
    // Move forward for command '1' or '1\n' (without newline character)
    digitalWrite(motor1A, HIGH);
    digitalWrite(motor1B, LOW);
    digitalWrite(motor2A, HIGH);
    digitalWrite(motor2B, LOW);
  } else if (cmd == 2 || cmd == 20) {
    // Move backward for command '2' or '2\n' (without newline character)
    digitalWrite(motor1A, LOW);
    digitalWrite(motor1B, HIGH);
    digitalWrite(motor2A, LOW);
    digitalWrite(motor2B, HIGH);
  } else if (cmd == 3 || cmd == 30) {

Search this board for the appropriate kio4 sample, there are lots.

Also, read the Ascii chart.

thank you for the reply ,
command = Serial.parseInt(); // Parse the incoming integer ....this code is the problem as you state

so I changed it to command = Serial. read(); ....and it works for data send and receive is got the same data
still the motor doesn't move maybe not enough voltage

I hope it's not a stepper motor.

nah its just tt gearmotor

Maybe if you post the circuit here one of the hardware people can spot something?