I am trying to read data via Bluetooth with softwareserial.h library, but Arduino reads all data coming from Bluetooth as "0". When I run the same code over the Serial monitor, my code works fine. I'm using Arduino Nano (Old Bootloader) and HC-05 (without button).
This is the code that I read data from Bluetooth or Serial monitor.
Serial.println("Speed: ");
while (bluetooth.available() == 0) {}
while (bluetooth.available() > 0) {
speed_int = bluetooth.parseInt();
}
Serial.println(speed_int);
stepper.setMaxSpeed(speed_int);
Serial.println("Velocity: ");
while (bluetooth.available() == 0) {}
while (bluetooth.available() > 0) {
velocity_int = bluetooth.parseInt();
}
Serial.println(velocity_int);
stepper.setAcceleration(velocity_int);
Sent 1000, 200, 1, 0 via Arduino Bluetooth Control app terminal.