Hardware Reference
In-Depth Information
Serial.begin(9600);
// connection state
boolean notConnected = true;
// Start GSM shield
while(notConnected)
{
if(gsm.begin(PINNUMBER)==GSM_READY)
notConnected = false;
else
{
Serial.println("Not connected");
delay(1000);
}
}
Serial.println("GSM initialized");
}
To shut down the modem, use shutdown() :
GSMAccess .shutdown();
This function does not take any parameters and returns a boolean : true if
the modem was shut down and false if the function is currently executing. If
this function returns false , it does not mean that the function failed, only that
the shutdown operation has not yet completed.
SMS Class
GSM modems can, of course, be used to send and receive SMS messages. To
enable SMS message services, use the GSM_SMS class:
GSM_SMS sms;
An SMS message is sent in three steps; i rst, the destination number is required.
Second, the text is entered. Finally, the message is coni rmed.
To set a destination telephone number, use beginSMS() :
sms .beginSMS(number);
The number parameter is a char array, the telephone number that will receive
the SMS message.
To i ll in the SMS body, use print() :
sms .print(message);
 
Search WWH ::




Custom Search