As with the previous example, to start the sketch, open your serial monitor,
and send any character. The Arduino will poll the shield for its phone
number, then ask you to send a text message.
Any text messages received will be printed out to the Serial Monitor along
with the sending phone number and date.
If the text of the message matches one of the strings we’re looking for, the
Arduino will send an SMS back to the sender with the desired information.
Using the Library: SMS
To use the SMS functionality of the library, there is a second object defined
as
sms
. There are a variety of functions available to the
sms
class, here’s
a quick overview:
Setting SMS Mode
sms.setMode(sms_mode)
sets the SMS mode of your cell shield. You can
either set the SMS mode to
SMS_PDU_MODE
(pure data mode) or
SMS_TEXT_MODE
(text strings). More often than not you’ll want to use
SMS_TEXT_MODE
to read and send SMS. This must be set explicitly before
using the
sms
functions!
Page 13 of 22