Arduino_MKRGPS - longitude()

Read the latitude of the GPS.

Syntax

GPS.latitude()

Parameters

None.

Returns

GPS longitude in degrees.

Example

// Check if there is new GPS data available
if (GPS.available()) {
    // Read GPS data
    float latitude = GPS.latitude();
    float longitude = GPS.longitude();

    // ...

    // Print GPS data
    Serial.print("Location: ");
    Serial.print(latitude, 7);
    Serial.print(", ");
    Serial.println(longitude, 7);
}

See also