Arduino Phone Shield acts as Arduino Shield via 1Sheeld

Buy 1Sheeld
Arduino GSM shield via smartphone

Check your phone if there’s an incoming call and get the number of the caller so you can take certain hardware actions, how about triggering an alarm just in case you forgot your phone in silent mode, you don’t want to miss this particular call! Or you can use it in the opposite direction as well to call a friend on a certain action from Arduino.

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.

Phone  library allows your Arduino to make phone calls or receive phone calls and do certain action within these phone calls.

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

Note

For Android M(6) or greater, there are permissions to be granted before using the Data Logger shield, please make sure to grant the permissions or else it may affect the application’s performance.

void call(const char *)

Call a certain phone.

 

SYNTAX
Phone.call(phoneNumber);

 

RETURNS
None.

 

PARAMETERS
Takes a const char array holding the number of the phone.

 

USAGE
Phone.call(“phoneNumber”);

 

void call(String)

Call a certain phone.

 

SYNTAX
Phone.call(phoneNumber);

 

RETURNS
None.

 

PARAMETERS
Takes a string object holding the number of the phone.

 

USAGE
String number= “phoneNumber” ;
Phone.call(number);

 

bool isRinging(void)

Checks if the phone is ringing.

 

SYNTAX
Phone.isRinging();

 

RETURNS
Returns a Yes “1” or No “0”.

 

PARAMETERS
None.

 

USAGE
Phone.isRinging();

 

char * getNumber(void)

Gets the number calling the smartphone.

 

SYNTAX
Phone.getNumber();

 

RETURNS
Returns a char array holding the number calling.

 

PARAMETERS
None.

 

USAGE
char* number = Phone.getNumber();

 

String getNumber(void)

Gets the number calling the smartphone.

 

SYNTAX
Phone.getNumber();

 

RETURNS
Returns a string object holding the number calling.

 

PARAMETERS
None.

 

USAGE
String number = Phone.getNumber();

 

void setOnCallStatusChange(void(*userFunction)(bool,char *))

Sets a certain individual function written by the user in the sketch to be called and runs its functionality once a phone is calling and sent by the application to the Arduino.

 

SYNTAX
Phone.setOnCallStatusChange(&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
Phone.setOnCallStatusChange(&myFunction);
/* myFunction exists under the loop function. */
/* This function will be invoked each time a new call comes to smratphone. */
void myFunction (bool isPhoneRinging ,char * phoneNumber)
{
       /* Print x-y-z axis values on the Terminal Shield. */
      if(!strcmp(phoneNumber ,“XXXXXXXXX”))
       {
          /* Turn on the LED. */
          digitalWrite(ledPin,HIGH);
       }
}

 

void setOnCallStatusChange(void(*userFunction)(bool,String))

Sets a certain individual function written by the user in the sketch to be called and runs its functionality once a phone is calling and sent by the application to the Arduino.

 

SYNTAX
Phone.setOnCallStatusChange(&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
Phone.setOnCallStatusChange(&myFunction);
/* myFunction exists under the loop function. */
/* This function will be invoked each time a new call comes to smratphone. */
void myFunction(bool isPhoneRinging ,String phoneNumber)
{
      String number = "XXXXXXXXXX";
       /* Print x-y-z axis values on the Terminal Shield. */
      if(phoneNumber == number)
       {
          /* Turn on the LED. */
          digitalWrite(ledPin,HIGH);
       }
}