Stray '\' in program error even though i am not using it for comments

void setup(){ Serial.begin(9600); delay(2500); Serial.println(“AT”); delay(2000); Serial.println(“AT+CMGF=1?); delay(1500); } void loop(){ delay(1500); Serial.print(“AT+CMGS=”); Serial.print(34,BYTE); Serial.print(“9406686543?); Serial.println(34,BYTE); delay(1500); Serial.println(“This is a sms fromxxx………. just saying hello….”); delay(1500); Serial.println(26,BYTE); while(1); }

Serial.print(34,BYTE);

BYTE is not an option there. Use BIN, DEC, HEX, or for floats, the precision.

“AT”

Right there (and a few other places) - change those quotes.

No code tags, I cannot see any '\' in that code fragment. You also did not provide the error you get.

No code tags, I cannot see any '\' in that code fragment.

The compiler actually sees the code as a series of integer values. The odd double quote is represented as \xxx in the stream of data that the compiler sees. So, the error message alludes to the fact that the \xxx value was not one that the compiler recognized. The message does not literally mean that there is a \ in the program in the wrong place.

It's rather ironic (In a Morrissette sort of way) that this Serial.println(34,BYTE); is the correct quote mark, just in an obsolete construct.

Changed a few things.

void setup(){
Serial.begin(9600);
delay(1);
Serial.println("AT");
delay(1);
Serial.println("AT+CMGF=1");
delay(1);
}
void loop(){
delay(1);
Serial.print("AT+CMGS=");
Serial.print(char(34)); 
Serial.print("9406686543");
Serial.println(char(34));
delay(1);
Serial.println("This is a sms fromxxx....... just saying hello...."); 
delay(1);
Serial.println(char(26)); 
while(1);
}

And got this.

AT AT+CMGF=1 AT+CMGS="9406686543" This is a sms fromxxx....... just saying hello.... 

Like AWOL mentioned, 34 is a quote,

Serial.print(char(34)); 
Serial.print("9406686543");
Serial.println(char(34));

The code above can simply be written as

Serial.print("\"9406686543\"");