Hello, I am using HC-06 and want to send the message. It is connected to Serial 2(9 and 10 pins). The code I am using is listed. Why I don't have Serial2.available?
Code:
void setup()
{
// set digital pin to control as an output
// set the data rate for the SoftwareSerial port
Serial2.begin(9600);
Serial.begin(9600);
// Send test message to other device
}
void loop() {
// put your main code here, to run repeatedly:
//Serial2.println("LEd on, in AT mode; input AT commands");
if (Serial2.available()>0)
{
Serial.println("habrahabr");
Serial2.print("123456");
Serial2.print ("\r\n");
}
delay(50);
}