
w w w . f u t - e l c t r o n i c s . c o m
Using a pen or a plastic tweezer access the reset switch on the Arduino Board and reset the
microcontroller to run the sketch from the start. Do not try resetting the Arduino by removing and
applying power to it as this will turn off the GPRS Shield.
If nothing goes wrong, the SMS will be received on receiver's handset.
void setup()
{
Serial.begin(19200); //Default serial port setting for the GPRS modem is 19200bps 8-N-1
Serial.print("\r");
delay(1000); //Wait for a second while the modem sends an "OK"
Serial.print("AT+CMGF=1\r"); //Because we want to send the SMS in text mode
delay(1000);
//Serial.print("AT+CSCA=\"XXXX32055002 \"\r"); //Setting for the SMS Message center number,
//delay(1000); //uncomment only if required and replace with
//the message center number obtained from
//your GSM service provider.
//Note that when specifying a tring of characters
// " is entered as \"
Serial.print("AT+CMGS=\"XXXX6043032\"\r"); //Start accepting the text for the message
//to be sent to the number specified.
//Replace this number with the target mobile number.
delay(1000);
Serial.print("SIM900 and Arduino say Hi!\r"); //The text for the message
delay(1000);
Serial.print(26,BYTE); //Equivalent to sending Ctrl+Z
}
void loop()
{
//We just want to send the SMS only once, so there is nothing in this loop.
//If we put the code for SMS here, it will be sent again and again and cost
us a lot.
}
Make a Call –Arduino code
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3);
void setup()
{
mySerial.begin(19200); // the GPRS baud rate
Serial.begin(19200); // the GPRS baud rate
delay(2000);
}
void loop()
Comentarios a estos manuales