Sim900A sending sms new line issue

Hi

I am attempting to send a sms via a button using a Sim900A and arduino uno. The sms controls an “ezy switch sms2 controller” which is a sms 12v relay device. It requires exact sms phrasing to operate.

My code sends an sms at the button press, however appears to add a new line (blank line/space) at the end of the sms, therefore the ezy switch does not work.

Is anyone able to view my code and explain how this could be occurring.

Thanks in advance;

#include <SoftwareSerial.h>
SoftwareSerial SIM900(7, 8);

int buttonPin = 4; // Send sms Off button
int buttonPin1 = 5; // Send sms On button

int buttonState = 0;
int buttonState1 = 0;

void setup()
{
SIM900.begin(19200);
pinMode(buttonPin, INPUT);
pinMode(buttonPin1, INPUT);
}

void sendSMS()
{
SIM900.print(“AT+CMGF=1\r”); // AT command to send SMS message
delay(100);
SIM900.println(“AT + CMGS = “+61???””); // Mobile Number of Ezy Switch
delay(100);
SIM900.println(“Turn output1 off”); // message to Ezy Switch
delay(100);
SIM900.println((char)26); // End AT command
delay(100);
}

void sendSMS2()
{
SIM900.print(“AT+CMGF=1\r”); // AT command to send SMS message
delay(100);
SIM900.println(“AT + CMGS = “+61???””); // Mobile Number of Ezy Switch
delay(100);
SIM900.println(“Turn output2 off”); // message to Ezy Switch
delay(100);
SIM900.println((char)26); // End AT command
delay(100);
}

void sendSMS3()
{
SIM900.print(“AT+CMGF=1\r”); // AT command to send SMS message
delay(100);
SIM900.println(“AT + CMGS = “+61???””); // Mobile Number of Ezy Switch
delay(100);
SIM900.println(“Turn output1 on”); // Message to Ezy Switch
delay(100);
SIM900.println((char)26); // End AT command
delay(100);
}

void sendSMS4()
{
SIM900.print(“AT+CMGF=1\r”); // AT command to send SMS message
delay(100);
SIM900.println(“AT + CMGS = “+61???””); // Mobile Number of Ezy Switch
delay(100);
SIM900.println(“Turn output2 on”); // message to Ezy Switch
delay(100);
SIM900.println((char)26); // End AT command
delay(100);
}

void loop()
{
buttonState = digitalRead(buttonPin);

if (buttonState == HIGH){

sendSMS();
delay(10000);
sendSMS2();
}

buttonState1 = digitalRead(buttonPin1);

if (buttonState1 == HIGH){
sendSMS3();
delay(10000);
sendSMS4();
}
}

Nice to see that you have read and embraced the guidelines at the top of the board, 'How to use this forum'.

Try using print instead of println.

My apologise for not adding code tags in my post.

Thank you Dannable, I new it would be something simple, but I had spent ages staring at the code that even the simplest thing did not jump out at me. All working as it should

Thanks!!!!