I witnessed a problem where hc05 sent data from pc to phone but it works only in one way. So when i try to type from my phone ,pc cant get that data
#include <SoftwareSerial.h>
SoftwareSerial mySerial(3, 2); // RX=3, TX=2
void setup() {
Serial.begin(9600); // PC communication
mySerial.begin(9600); // HC-05 communication
Serial.println("Ready! Send data from phone...");
}
void loop() {
// Check if HC-05 is sending data (Phone β Arduino)
if (mySerial.available()) {
String data = mySerial.readStringUntil('\n');
Serial.print("Received: ");
Serial.println(data); // Print to Serial Monitor
}
// Check if Serial Monitor is sending data (PC β Phone)
if (Serial.available()) {
mySerial.write(Serial.read()); // Relay to HC-05
}
}
that is the code . i checked connection of wires and it is ok ,also i made a loopback test so both tx and rx is working
pls help meUse code tags to format code for the forum

