led wont turn on with gsm shield

what do i have to do make this code work

#include "SIM900.h"
#include <SoftwareSerial.h>
//If not used, is better to exclude the HTTP library,
//for RAM saving.
//If your sketch reboots itself proprably you have finished,
//your memory available.
//#include "inetGSM.h"

//If you want to use the Arduino functions to manage SMS, uncomment the lines below.
#include "sms.h"

//To change pins for Software Serial, use the two lines in GSM.cpp.

//GSM Shield for Arduino
//this code is based on the example of Arduino Labs.

//Simple sketch to send and receive SMS.

int numdata;
boolean started=false;
char smsbuffer[160];
char n[20];

void setup() 
  pinMode(13, OUTPUT);
  //Serial connection.
  Serial.println("GSM Shield testing.");
  //Start configuration of shield with baudrate.
  //For http uses is raccomanded to use 4800 or slower.
  if (gsm.begin(2400)){
  else Serial.println("\nstatus=IDLE");
    //Enable this two lines if you want to send an SMS.
    if (sms.SendSMS("##########", "Arduino SMS"))
     Serial.println("\nSMS sent OK");


void loop() 
    //Read if there are messages on SIM card and print them.
    if(gsm.readSMS(smsbuffer, 160, n, 20))
      if (smsbuffer == "turn on led"){

Why doesn't it work? Did you drop the GSM_Shield.h from the other thread?

const char MSG_ON[] = "turn on led";
if (strcmp(smsbuffer, MSG_ON) == 0) digitalWrite(13, HIGH);

lol. nothing happened when i used to upload led did not turn on like i asked it to.

now its saying 'MSG_ON' does not name a type

UPS.. Just edited my previous post..

same thing happened

i asked the serial monitor what the strcmp value was and it was 13

than i changed the code for if (strcmp(smsbuffer, MSG_ON) >= 0 ) digitalWrite(13, HIGH);

than it worked

i also asked the serial mon to read both smsbuffer and MSG_ON. and they were the same

although it was giving me 13

strcmp() will stop when it reaches the first character that is different between two strings. This implementation returns the difference between the two character values where the two strings differ. It appears that smsbuffer contains a carriage return character (value 13) in the same position that MSG_ON has a nul character (value 0), which would cause strcmp() to return the value 13.

When you print the strings to the Serial Monitor, put quotes or some other delimiter around them so you can see if there's any invisible characters like a carriage return.

same thing happened just a random number. everytime i upload i new sketch it shows a different number



Anybody want to guess what code we can't see is doing, and how that differs what you want it to do? I'll give it a try. Mind taping these electrodes to your forehead? Don't mind that 440VAC power cord. The amperage will be very low. Trust me. Not more than 100 amps. You'll wake up again. I hope.