I am using SIM900 with arduino mega and have to send a message to a specific number I store in a variable, using AT commands. I am storing the number as a String but it gives an error. Below are the relevant lines of code:
String number1 = "923360234233";
Serial1.write("AT+CMGS=\"" + number1 + "\"");
It gives the following error.
no matching function for call to 'HardwareSerial::write(StringSumHelper&)'
What am I doing wrong here?