You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/hardware/01.mkr/02.shields/mkr-gps-shield/tutorials/getting-started/content.md
+8-85Lines changed: 8 additions & 85 deletions
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ author: Arduino
8
8
9
9
## Introduction
10
10
11
-
The MKR GPS Shield is based on the u-blox [SAM-M8Q](https://www.u-blox.com/sites/default/files/SAM-M8Q_DataSheet_%28UBX-16012619%29.pdf) GNSS (Global Navigation Satellite System) module. This module is designed to operate with different positioning services concurrently. It receives and processes the signals from [GPS](https://en.wikipedia.org/wiki/Global_Positioning_System), [GLONASS](https://en.wikipedia.org/wiki/GLONASS) and [Galileo](https://en.wikipedia.org/wiki/Galileo_satellite_navigation).
11
+
The MKR GPS Shield is based on the u-blox®[SAM-M8Q](https://www.u-blox.com/sites/default/files/SAM-M8Q_DataSheet_%28UBX-16012619%29.pdf) GNSS (Global Navigation Satellite System) module. This module is designed to operate with different positioning services concurrently. It receives and processes the signals from [GPS](https://en.wikipedia.org/wiki/Global_Positioning_System), [GLONASS](https://en.wikipedia.org/wiki/GLONASS) and [Galileo](https://en.wikipedia.org/wiki/Galileo_satellite_navigation).
12
12
13
13
The reception of different services at the same time makes this shield suitable for outdoor applications around the world with an accurate calculation of the position down to a few meters. Multiple constellations means also more satellites in sight in environments like cities with tall buildings or areas with deep valleys and limited sky view.
14
14
@@ -35,34 +35,30 @@ Six solder pads allow the configuration of the connection between the module and
35
35
| EXTINT | 2 | Y |
36
36
| TP | 1 | N |
37
37
38
-
The shield has been designed to be used with a MKR Board as host through the headers or in a detached way, with the I2C connector that supports the power supply through the pin 1.
38
+
The shield has been designed to be used with a MKR board as host through the headers or in a detached way, with the I2C connector that supports the power supply through pin 1.
39
39
40
-
The module runs at a maximum voltage of 3.3V and it is not 5V tolerant, so if you plan to use it in a design where the signal levels for communication are managed by a board that has a 5V microcontroller, you need to add a logic level converter 5V<->3.3V to safeguard the module input ports.
40
+
The module runs at a maximum voltage of 3.3 V and it is not 5 V tolerant, so if you plan to use it in a design where the signal levels for communication are managed by a board that has a 5 V microcontroller, you need to add a logic level converter 5V<->3.3V to safeguard the module input ports.
41
41
42
42
The patch antenna is omnidirectional and should be kept with a clear sky view. Please remember that some car windshields are laminated with filters for IR and UV light that also shield electromagnetic signals. Usually the front windshield has a dedicated uncoated zone, useful for GNSS signal reception, near the rear mirror.
43
43
44
44
### Software
45
45
46
-
The MKR GPS Shield is connected through Serial1 to the MKR Board or through I2C / DCC protocol on the 5pin connector. You can specify the type of connection you are using in the creator API `begin()` of our [Arduino_MKRGPS](/en/Reference/ArduinoMKRGPS) library that supports both in a transparent way for all the other APIs.
46
+
The MKR GPS Shield is connected through Serial1 to the MKR board or through I2C / DCC protocol on the 5pin connector. You can specify the type of connection you are using in the creator API `begin()` of our [Arduino_MKRGPS](/en/Reference/ArduinoMKRGPS) library that supports both in a transparent way for all the other APIs.
47
47
48
48
### Examples
49
49
50
-
The following sketch print continuously on the serial console the position and the
50
+
The following sketch print continuously on the serial console the position.
51
51
52
52
```c
53
53
/*
54
54
55
55
GPS Location
56
-
57
56
This sketch uses the GPS to determine the location of the board
58
-
59
57
and prints it to the Serial monitor.
60
58
61
59
Circuit:
62
-
63
60
- MKR board
64
-
65
-
- MKR GPS attached via I2C cable
61
+
- MKR GPS Shield attached via I2C cable
66
62
67
63
This example code is in the public domain.
68
64
@@ -71,27 +67,18 @@ The following sketch print continuously on the serial console the position and t
71
67
#include<Arduino_MKRGPS.h>
72
68
73
69
voidsetup() {
74
-
75
70
// initialize serial communications and wait for port to open:
76
-
77
71
Serial.begin(9600);
78
-
79
72
while (!Serial) {
80
-
81
73
; // wait for serial port to connect. Needed for native USB port only
82
-
83
74
}
84
75
85
76
// If you are using the MKR GPS as shield, change the next line to pass
86
-
87
77
// the GPS_MODE_SHIELD parameter to the GPS.begin(...)
88
78
89
79
if (!GPS.begin()) {
90
-
91
80
Serial.println("Failed to initialize GPS!");
92
-
93
81
while (1);
94
-
95
82
}
96
83
}
97
84
@@ -100,47 +87,28 @@ void loop() {
100
87
// check if there is new GPS data available
101
88
102
89
if (GPS.available()) {
103
-
104
90
// read GPS values
105
-
106
91
float latitude = GPS.latitude();
107
-
108
92
float longitude = GPS.longitude();
109
-
110
93
float altitude = GPS.altitude();
111
-
112
94
float speed = GPS.speed();
113
-
114
95
int satellites = GPS.satellites();
115
96
116
97
// print GPS values
117
98
118
99
Serial.print("Location: ");
119
-
120
100
Serial.print(latitude, 7);
121
-
122
101
Serial.print(", ");
123
-
124
102
Serial.println(longitude, 7);
125
-
126
103
Serial.print("Altitude: ");
127
-
128
104
Serial.print(altitude);
129
-
130
105
Serial.println("m");
131
-
132
106
Serial.print("Ground speed: ");
133
-
134
107
Serial.print(speed);
135
-
136
108
Serial.println(" km/h");
137
-
138
109
Serial.print("Number of satellites: ");
139
-
140
110
Serial.println(satellites);
141
-
142
111
Serial.println();
143
-
144
112
}
145
113
}
146
114
```
@@ -151,17 +119,13 @@ This second example keeps the power consumption under control waking up the modu
151
119
/*
152
120
153
121
GPS Location Standby
154
-
155
122
This sketch uses the GPS to determine the location of the board
156
-
157
-
and prints it to the Serial monitor.
123
+
and prints it to the Serial Monitor.
158
124
159
125
It puts the GPS to in standby mode every 10 seconds, then wakes it up.
160
126
161
127
Circuit:
162
-
163
128
- MKR board
164
-
165
129
- MKR GPS attached via I2C cable
166
130
167
131
This example code is in the public domain.
@@ -171,104 +135,63 @@ This second example keeps the power consumption under control waking up the modu
171
135
#include<Arduino_MKRGPS.h>
172
136
173
137
voidsetup() {
174
-
175
138
// initialize serial communications and wait for port to open:
176
-
177
139
Serial.begin(9600);
178
-
179
140
while (!Serial) {
180
-
181
141
; // wait for serial port to connect. Needed for native USB port only
182
-
183
142
}
184
143
185
144
// If you are using the MKR GPS as shield, change the next line to pass
186
-
187
145
// the GPS_MODE_SHIELD parameter to the GPS.begin(...)
0 commit comments