Arduino_MKRGPS - variation()

Read the magnetic variation of the GPS.

Syntax

GPS.variation()

Parameters

None.

Returns

GPS magnetic variation in degrees.

Example

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

    // ...

    // Print GPS data
    Serial.print("Variation: ");
    Serial.print(variation);
    Serial.println(" degrees");
}

See also