user18763: Sorry, im a beginner, i tried to program an automatic doorlock using sms. But, I dont understand what happen with this error, what should I do? Add library? The error said that Pstring wasnt declared, but i dont know how to declare this.
#include <LiquidCrystal.h>
#include "SIM900.h"
#include "sms.h"
#include "SoftwareSerial.h"
#include "sms.h"

SMSGSM sms;
boolean started=false;
char buffer[160];
char smsbuffer[160];
char n[20];
int pintu=5;
int buttonState;
int lastButtonState = LOW;
long lastDebounceTime = 0;
long debounceDelay = 50;
boolean st=false;
int buzzer=6;

void setup()
{
  pinMode(pintu,OUTPUT);
  pinMode(buzzer,OUTPUT);

  digitalWrite(pintu,LOW);
 if (gsm.begin(9600))
 {
  started=true; 
   digitalWrite(buzzer,HIGH);
   delay(100);
   digitalWrite(buzzer,LOW);
   delay(100);
   digitalWrite(buzzer,HIGH);
   delay(100);
   digitalWrite(buzzer,LOW);
   delay(100);
   digitalWrite(buzzer,HIGH);
   delay(100);
   digitalWrite(buzzer,LOW);
   delay(100);
  }
   if(started)
  {
   delsms();
   sms.SendSMS("08970869443","Pintu SMS Menyala");
  }
  else{digitalWrite(buzzer,HIGH); delay(2000); digitalWrite(buzzer,LOW);
  }


   }

   void loop()
   {

   int pos=0;
  if (gsm.begin(9600))
  {
  if (started){
  pos=sms.IsSMSPresent(SMS_ALL);
  if(pos)
  {
   sms.GetSMS(pos,n,smsbuffer,100);
   delay(2000);
    if(!strcmp(smsbuffer,"bukapintu"))
    {
      PString str(buffer, sizeof(buffer));
    str.begin();
    str.print("Pintu Dibuka");
    digitalWrite(pintu,HIGH);
   // String a=str
    sms.SendSMS(n,buffer);
    }
    if(!strcmp(smsbuffer,"tutuppintu"))
    {
      PString str(buffer, sizeof(buffer));
    str.begin();
    str.print("Kunci Pintu Ditutup");
    digitalWrite(pintu,LOW);
   // String a=str
    sms.SendSMS(n,buffer);
    }
    delsms();
   }
   }
   }
   }

   void delsms()
   {
   for (int i=0; i<10; i++)
  {  
     int pos=sms.IsSMSPresent(SMS_ALL);
    if (pos!=0)
   {
    if (sms.DeleteSMS(pos)==1){}else{}
   }
   }
   }

Error message :
     Arduino: 1.6.7 (Windows 10), Board: "Arduino/Genuino Uno"

      D:\Kuliah\Project\Skripsi\pintu_sms\pintu_sms.ino: In function 'void loop()':

      pintu_sms:67: error: 'PString' was not declared in this scope

       PString str(buffer, sizeof(buffer));

       ^

      pintu_sms:67: error: expected ';' before 'str'

       PString str(buffer, sizeof(buffer));

               ^

     pintu_sms:68: error: 'str' was not declared in this scope

     str.begin();

     ^

    pintu_sms:76: error: 'PString' was not declared in this scope

       PString str(buffer, sizeof(buffer));

       ^

    pintu_sms:76: error: expected ';' before 'str'

       PString str(buffer, sizeof(buffer));

               ^

     pintu_sms:77: error: 'str' was not declared in this scope

     str.begin();

     ^

     exit status 1
  'PString' was not declared in this scope


user13432: The compiler does not know what PString is. It is not declared in any of the libraries you have included.
You could rewrite to something like this. 
strcat(buffer, "Pintu Dibuka");
n = strlen(buffer);
digitalWrite(pintu,HIGH);
sms.SendSMS(n,buffer);

Please change the other block in the same way. 
There are more errors. You also need to change "int n[20]" to "int n". 
That is a good start.
Cheers!

18763: <p>Sorry, im a beginner, i tried to program an automatic doorlock using sms. But, I dont understand what happen with this error, what should I do? Add library? The error said that Pstring wasnt declared, but i dont know how to declare this.</p>

<pre><code>#include &lt;LiquidCrystal.h&gt;
#include "SIM900.h"
#include "sms.h"
#include "SoftwareSerial.h"
#include "sms.h"

SMSGSM sms;
boolean started=false;
char buffer[160];
char smsbuffer[160];
char n[20];
int pintu=5;
int buttonState;
int lastButtonState = LOW;
long lastDebounceTime = 0;
long debounceDelay = 50;
boolean st=false;
int buzzer=6;

void setup()
{
  pinMode(pintu,OUTPUT);
  pinMode(buzzer,OUTPUT);

  digitalWrite(pintu,LOW);
 if (gsm.begin(9600))
 {
  started=true; 
   digitalWrite(buzzer,HIGH);
   delay(100);
   digitalWrite(buzzer,LOW);
   delay(100);
   digitalWrite(buzzer,HIGH);
   delay(100);
   digitalWrite(buzzer,LOW);
   delay(100);
   digitalWrite(buzzer,HIGH);
   delay(100);
   digitalWrite(buzzer,LOW);
   delay(100);
  }
   if(started)
  {
   delsms();
   sms.SendSMS("08970869443","Pintu SMS Menyala");
  }
  else{digitalWrite(buzzer,HIGH); delay(2000); digitalWrite(buzzer,LOW);
  }


   }

   void loop()
   {

   int pos=0;
  if (gsm.begin(9600))
  {
  if (started){
  pos=sms.IsSMSPresent(SMS_ALL);
  if(pos)
  {
   sms.GetSMS(pos,n,smsbuffer,100);
   delay(2000);
    if(!strcmp(smsbuffer,"bukapintu"))
    {
      PString str(buffer, sizeof(buffer));
    str.begin();
    str.print("Pintu Dibuka");
    digitalWrite(pintu,HIGH);
   // String a=str
    sms.SendSMS(n,buffer);
    }
    if(!strcmp(smsbuffer,"tutuppintu"))
    {
      PString str(buffer, sizeof(buffer));
    str.begin();
    str.print("Kunci Pintu Ditutup");
    digitalWrite(pintu,LOW);
   // String a=str
    sms.SendSMS(n,buffer);
    }
    delsms();
   }
   }
   }
   }

   void delsms()
   {
   for (int i=0; i&lt;10; i++)
  {  
     int pos=sms.IsSMSPresent(SMS_ALL);
    if (pos!=0)
   {
    if (sms.DeleteSMS(pos)==1){}else{}
   }
   }
   }
</code></pre>

<p>Error message :</p>

<pre><code>     Arduino: 1.6.7 (Windows 10), Board: "Arduino/Genuino Uno"

      D:\Kuliah\Project\Skripsi\pintu_sms\pintu_sms.ino: In function 'void loop()':

      pintu_sms:67: error: 'PString' was not declared in this scope

       PString str(buffer, sizeof(buffer));

       ^

      pintu_sms:67: error: expected ';' before 'str'

       PString str(buffer, sizeof(buffer));

               ^

     pintu_sms:68: error: 'str' was not declared in this scope

     str.begin();

     ^

    pintu_sms:76: error: 'PString' was not declared in this scope

       PString str(buffer, sizeof(buffer));

       ^

    pintu_sms:76: error: expected ';' before 'str'

       PString str(buffer, sizeof(buffer));

               ^

     pintu_sms:77: error: 'str' was not declared in this scope

     str.begin();

     ^

     exit status 1
  'PString' was not declared in this scope
</code></pre>
 13432: <p>The compiler does not know what PString is. It is not declared in any of the libraries you have included.</p>

<p>You could rewrite to something like this. </p>

<pre><code>strcat(buffer, "Pintu Dibuka");
n = strlen(buffer);
digitalWrite(pintu,HIGH);
sms.SendSMS(n,buffer);
</code></pre>

<p>Please change the other block in the same way. </p>

<p>There are more errors. You also need to change "int n[20]" to "int n". </p>

<p>That is a good start.</p>

<p>Cheers!</p>
