SoftwareSerial mySerial(18, 19);
Do not use software serial on the Mega. Use Serial1 on those pins. See this thread https://forum.arduino.cc/t/using-hc-05-and-mega-2560/857677
SoftwareSerial mySerial(18, 19);
Do not use software serial on the Mega. Use Serial1 on those pins. See this thread https://forum.arduino.cc/t/using-hc-05-and-mega-2560/857677