SMS Shield acts as Arduino Shield via 1Sheeld

Buy 1Sheeld
SMS Shield acts as Arduino Shield via 1Sheeld

Buy 1Sheeld

Allows you to send an SMS to a phone number when a certain trigger is on.
Learn more from the examples page.
This shield is one of the communication shields.

Communication shields allow you to use your smartphone as a gateway between Arduino and other phones, they make it easier to communicate with your Arduino board by sending and receiving data to or from another phone.
Learn more from the communication shields tutorial.

SMS  library allows your Arduino to send and receive SMS’s to phones.

Adding #define CUSTOM_SETTINGS along with #define INCLUDE_SMS_SHIELD is a key that will let you unlock the SMS shield only amongst all shields and prevent 1Sheeld library from eating your memory specially for UNO board.

“There are permissions to be granted by Android M users before they can use the SMS shield please make sure to grant the permissions or else it may affect the application’s performance.”

Sends an SMS to a certain phone.

SYNTAX

SMS.send (phoneNumber,bodyMessage);

RETURNS

None.

PARAMETERS

1st Parameter takes the phone number as array of char.

2nd Parameter takes body message as array of char.

USAGE

SMS.send(“XXXXXXXX”,”bodyMessage”);

Sends an SMS to a certain phone.

SYNTAX

SMS.send (phoneNumber,bodyMessage);

RETURNS

None.

PARAMETERS

1st Parameter takes the phone number as String object.

2nd Parameter takes body message as String object.

USAGE

String number= “XXXXXXXX” ;
String message= “bodyMessage” ;
SMS.send(number,message);

Checks if a new SMS received.

Note: using this function individual without invoking getNumber or getSms functions will always hit true as an indication that the last SMS is the newest one, So rather than using isNewSms individually “in case you are not interested in the SMS or even the number” then use the callback function setOnNewSmsReceive and whenever an SMS is received it will invoke your customized function.

SYNTAX

SMS.isNewSms( );

RETURNS

None.

PARAMETERS

None.

USAGE

SMS.isNewSms();

Gets back the number messaged the smartphone.

SYNTAX

SMS.getNumber( );

RETURNS

Numbers as array of char.

PARAMETERS

None.

USAGE

char* number = SMS.getNumber( );

Gets back the number messaged the smartphone.

SYNTAX

SMS.getNumberAsString( );

RETURNS

Numbers as String object.

PARAMETERS

None.

USAGE

String  number = SMS.getNumberAsString();

Gets back the  message sent to the smartphone.

SYNTAX

SMS.getSms( );

RETURNS

Sms body message as array of char.

PARAMETERS

None.

USAGE

char* sms= SMS.getSms();

Gets back the  message sent to the smartphone.

SYNTAX

SMS.getSmsAsString( );

RETURNS

Sms body message as String object.

PARAMETERS

None.

USAGE

String  sms = SMS.getSmsAsString();

Sets a certain individual function written by the user in the sketch to be called and runs its functionality once a new SMS is received by the smartphone.

SYNTAX

SMS.setOnSmsReceive(&userFunctionName);

RETURNS

None.

PARAMETERS

&userFunctionName: takes the physical address of the userFunction in the memory and jump to it once called to execute it’s functionality.

USAGE

SMS.setOnSmsReceive(&myFunction);
/* myFunction exists under the loop function. */
/* This function will be invoked each time a new sms comes to smratphone. */
void myFunction (char * phoneNumber ,char * messageBody)
{
    /* Print out the phone Number and message on Terminal shield. */
    Terminal.println(phoneNumber);
    Terminal.println(mesageBody);
}

Sets a certain individual function written by the user in the sketch to be called and runs its functionality once a new SMS is received by the smartphone.

SYNTAX

SMS.setOnSmsReceive(&userFunctionName);

RETURNS

None.

PARAMETERS

&userFunctionName: takes the physical address of the userFunction in the memory and jump to it once called to execute it’s functionality.

USAGE

SMS.setOnSmsReceive(&myFunction);
/* myFunction exists under the loop function. */
/* This function will be invoked each time a new sms comes to smratphone. */
void myFunction (String phoneNumber ,String messageBody)
{
    /* Print out the phone Number and message on Terminal shield. */
    Terminal.println(phoneNumber);
    Terminal.println(mesageBody);
}