Categories

Examples of the A-GSM shield application

Examples of usage A-GSM shield

To connect with cap-And-GSM-Shield was applied library available on the website www.github.com. It allows you to use features of the module.

 

In the example, we used the following elements:

 

For module-GSM-Shield, insert SIM card, then put it on the Arduino. The next step is the connection, taken library for the environment Arduino (Sketch -> Include Library -> Add .ZIP Library)

 

Sending SMS messages

For SMS we use a very simple example:

 

#include "SIM900.h" 
#include  
#include "sms.h" 

SMSGSM sms; 

void setup() 
{ 
 Serial.begin(9600); 
 if (gsm.begin(2400)) // module initialization 
 { 
 Serial.println("Sending..."); 
 if (sms.SendSMS("+48111111111", "Example text")) // the phone number and the message text 
 Serial.println("nWysyłanie message, "error"); 
 } 
}; 

void loop() 
{}; 

 

The program is based on the example attached to the above-mentioned library. It can be used to send SMS to specified phone number (text message and the recipient's phone number, enter in the marked areas).

 

Connection

To connect we will use the following program:

 

#include "SIM900.h" 
#include  
#include "call.h" 

CallGSM call; 

void setup() 
{ 
 Serial.begin(9600); // 
 gsm.begin(2400); // initialize the module 
}; 

void loop() 
{ 
 if (call.CallStatus() != CALL_ACTIVE_VOICE) 
 { 
 Serial.println("connecting"); 
 call.Call("+48111111111"); // the number of the recipient 
 } 
 delay(1000); 
}; 

 

The program establishes a connection with the selected phone number.