GPS Shield acts as Arduino Shield via 1Sheeld

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

Buy 1Sheeld

Get the location of a moving object by getting the coordinates (longitude and latitude) easily from your phone
using two lines of code in your sketch, can be used as input to the Arduino to
trigger a certain action.

Learn more from the examples page.

This shield is one of the sensor shields. Sensor shields allows you to tap into your smartphone’s sensors and use in prototyping with Arduino, you can get information from the surrounding environment and use
it to trigger a certain action. Learn more from the sensor shields tutorial.

GPS Library allows Arduino board to get location data from the smartphone’s gps and takes certain actions within these data.

Adding #define CUSTOM_SETTINGS along with #define INCLUDE_GPS_SENSOR_SHIELD is a key that will let you unlock the GPS sensor 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 GPS shield please make sure to grant the permissions or else it may affect the application’s performance.”

Returns current latitude according to the smartphone’s current place.

SYNTAX

GPS.getLatitude( );

RETURNS

float latitude in degrees.

PARAMETERS

None.

USAGE

float latitude = GPS.getLatitude();

Returns longitude according to the smartphone’s current place.

SYNTAX

GPS.getLongitude( );

RETURNS

float longitude in degrees.

PARAMETERS

None.

USAGE

float longitude = GPS.getLongitude();

This function checks if your smartphone is in range giving the fixed latitude and longitude and range to be compared in meters.

SYNTAX

GPS.isInRange(fixedLatitude ,fixedLongitude ,rangeInMeters);

RETURNS

A yes “1” or no “0” if within range or not.

PARAMETERS

1st Parameter takes the fixed value of latitude.

2nd Parameter takes the fixed value of longitude.

3rd Parameter takes the range to be checked on”meters”.

USAGE

if(GPS.isInRange(30.0831008,31.3242943,100))
{
    pinMode(pin13,OUTPUT);
    digitalWrite(pin13,HIGH);
}
else
{
    digitalWrite(pin13,LOW);
}

This function returns the distance between the given fixed latitude and longitude and the smartphone’s current place.

SYNTAX

GPS.getDistance(fixedLatitude ,fixedLongitude);

RETURNS

float distance in meters.

PARAMETERS

1st Parameter takes fixed latitude value.

2nd Parameter takes fixed longitude value.

USAGE

float distance = GPS.getDistance(30.0831008,31.3242943);

Helper function to convert latitude or longitude values to radians.

SYNTAX

GPS.radian(latitude/longitude);

RETURNS

value in radians.

PARAMETERS

Takes latitude/longitude value.

USAGE

float distance = GPS.radian(30.0831008);

Sets a certain individual function written by the user in the sketch to be called and runs its functionality once a latitude or longitude change occurs.

SYNTAX

GPS.setOnValueChange(&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

GPS.setOnValueChange(&myFunction);
/* myFunction exists under the loop function. */
/* This function will be invoked each time a new value comes to arduino from the  
     smartphones gps sensor. */
void myFunction (float latitude , float longitude)
{
    /* Turn on the led once any button is pressed*/
    if(upButton)
    {
    
        pinMode(pin13 ,OUTPUT);
        digitalWrite(pin13 ,HIGH);
    }
}