SoftwareSerial bluetooth(8, 9); // RX, TX if (bluetooth.available() > 0);
String string1 = "*left#";
{
//off();
data = bluetooth.readString();
// }
//Serial.print("data:");
Serial.println(data);
if (data.equals(string1))
{
Serial.println("LEFT");
left();
}
void left()
{
digitalWrite(in1, LOW);
digitalWrite(in2, LOW);
digitalWrite(in3, LOW);
digitalWrite(in4, HIGH);
Ive used this code to communicate from my phone to HC-05 module,
but in the serial monitor the following message is being displayed:
Invalid3121
3121
bluetooth
Invalid3143
3143
bluetooth
the arduino in not receiving the string sent from the phone, is there any issue with the codes?