Skip to content

Commit 075f26d

Browse files
authored
Update content.md
1 parent 48fe5c4 commit 075f26d

File tree

1 file changed

+8
-85
lines changed
  • content/hardware/01.mkr/02.shields/mkr-gps-shield/tutorials/getting-started

1 file changed

+8
-85
lines changed

content/hardware/01.mkr/02.shields/mkr-gps-shield/tutorials/getting-started/content.md

Lines changed: 8 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ author: Arduino
88

99
## Introduction
1010

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).
1212

1313
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.
1414

@@ -35,34 +35,30 @@ Six solder pads allow the configuration of the connection between the module and
3535
| EXTINT | 2 | Y |
3636
| TP | 1 | N |
3737

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.
3939

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.
4141

4242
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.
4343

4444
### Software
4545

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.
4747

4848
### Examples
4949

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.
5151

5252
```c
5353
/*
5454
5555
GPS Location
56-
5756
This sketch uses the GPS to determine the location of the board
58-
5957
and prints it to the Serial monitor.
6058
6159
Circuit:
62-
6360
- MKR board
64-
65-
- MKR GPS attached via I2C cable
61+
- MKR GPS Shield attached via I2C cable
6662
6763
This example code is in the public domain.
6864
@@ -71,27 +67,18 @@ The following sketch print continuously on the serial console the position and t
7167
#include <Arduino_MKRGPS.h>
7268

7369
void setup() {
74-
7570
// initialize serial communications and wait for port to open:
76-
7771
Serial.begin(9600);
78-
7972
while (!Serial) {
80-
8173
; // wait for serial port to connect. Needed for native USB port only
82-
8374
}
8475

8576
// If you are using the MKR GPS as shield, change the next line to pass
86-
8777
// the GPS_MODE_SHIELD parameter to the GPS.begin(...)
8878

8979
if (!GPS.begin()) {
90-
9180
Serial.println("Failed to initialize GPS!");
92-
9381
while (1);
94-
9582
}
9683
}
9784

@@ -100,47 +87,28 @@ void loop() {
10087
// check if there is new GPS data available
10188

10289
if (GPS.available()) {
103-
10490
// read GPS values
105-
10691
float latitude = GPS.latitude();
107-
10892
float longitude = GPS.longitude();
109-
11093
float altitude = GPS.altitude();
111-
11294
float speed = GPS.speed();
113-
11495
int satellites = GPS.satellites();
11596

11697
// print GPS values
11798

11899
Serial.print("Location: ");
119-
120100
Serial.print(latitude, 7);
121-
122101
Serial.print(", ");
123-
124102
Serial.println(longitude, 7);
125-
126103
Serial.print("Altitude: ");
127-
128104
Serial.print(altitude);
129-
130105
Serial.println("m");
131-
132106
Serial.print("Ground speed: ");
133-
134107
Serial.print(speed);
135-
136108
Serial.println(" km/h");
137-
138109
Serial.print("Number of satellites: ");
139-
140110
Serial.println(satellites);
141-
142111
Serial.println();
143-
144112
}
145113
}
146114
```
@@ -151,17 +119,13 @@ This second example keeps the power consumption under control waking up the modu
151119
/*
152120
153121
GPS Location Standby
154-
155122
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.
158124
159125
It puts the GPS to in standby mode every 10 seconds, then wakes it up.
160126
161127
Circuit:
162-
163128
- MKR board
164-
165129
- MKR GPS attached via I2C cable
166130
167131
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
171135
#include <Arduino_MKRGPS.h>
172136

173137
void setup() {
174-
175138
// initialize serial communications and wait for port to open:
176-
177139
Serial.begin(9600);
178-
179140
while (!Serial) {
180-
181141
; // wait for serial port to connect. Needed for native USB port only
182-
183142
}
184143

185144
// If you are using the MKR GPS as shield, change the next line to pass
186-
187145
// the GPS_MODE_SHIELD parameter to the GPS.begin(...)
188146

189147
if (!GPS.begin()) {
190-
191148
Serial.println("Failed to initialize GPS!");
192-
193149
while (1);
194-
195150
}
196151
}
197152

198153
void loop() {
199-
200154
// put the GPS in standby mode
201-
202155
Serial.println("standby");
203-
204156
GPS.standby();
205-
206157
// wait for 10 seconds
207-
208158
Serial.print("delay ");
209-
210159
for (int i = 0; i < 10; i++) {
211-
212160
delay(1000);
213-
214161
Serial.print(".");
215-
216162
}
217163

218164
Serial.println();
219-
220165
// wake up the GPS
221-
222166
Serial.println("wakeup");
223-
224167
GPS.wakeup();
225-
226168
Serial.print("wait location ... ");
227-
228169
// wait for new GPS data to become available
229-
230170
unsigned long startMillis = millis();
231-
232171
while (!GPS.available());
233-
234172
unsigned long endMillis = millis();
235-
236173
Serial.print(endMillis - startMillis);
237-
238174
Serial.println(" ms");
239175

240176
// read GPS values
241177

242178
float latitude = GPS.latitude();
243-
244179
float longitude = GPS.longitude();
245-
246180
float altitude = GPS.altitude();
247-
248181
int satellites = GPS.satellites();
249182

250183
// print GPS values
251184

252185
Serial.println();
253-
254186
Serial.print("Location: ");
255-
256187
Serial.print(latitude, 7);
257-
258188
Serial.print(", ");
259-
260189
Serial.println(longitude, 7);
261-
262190
Serial.print("Altitude: ");
263-
264191
Serial.print(altitude);
265-
266192
Serial.println("m");
267-
268193
Serial.print("Number of satellites: ");
269-
270194
Serial.println(satellites);
271-
272195
Serial.println();
273196
}
274-
```
197+
```

0 commit comments

Comments
 (0)