Arduino_MKRGPS - available()

Query if new GPS data is available().

Syntax

GPS.available()

Parameters

None.

Returns

0 if no new GPS data is available, 1 if new GPS data is available.

Example

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

    // ...
}

See also