Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Michal Rybka
openCanSat-2.0-library
Commits
3626f853
Commit
3626f853
authored
Jul 29, 2018
by
Markéta Jedličková
Browse files
GPS test example for OpenCansat library added
parent
47424361
Changes
1
Hide whitespace changes
Inline
Side-by-side
examples/3-Each-module-examples/GPStest.ino
0 → 100644
View file @
3626f853
#include
<Wire.h>
#include
"OpenCansatGPS.h"
#define Serial SerialUSB
OpenCansatGPS
gps
;
// CONFIG
const
uint16_t
msDelay
=
2000
;
void
setup
()
{
while
(
!
SerialUSB
)
{}
Serial
.
begin
(
57600
);
Serial
.
println
(
"OpenCansat gps test"
);
gps
.
begin
();
// Uncomment when you wanna see debug prints from library
//gps.debugPrintOn();
}
void
loop
()
{
uint32_t
start
=
millis
();
if
(
gps
.
scan
(
600
*
1000
))
{
Serial
.
println
(
String
(
" time to find fix: "
)
+
(
millis
()
-
start
)
+
String
(
"ms"
));
Serial
.
println
(
String
(
" datetime = "
)
+
gps
.
getDateTimeString
());
Serial
.
println
(
String
(
" lat = "
)
+
String
(
gps
.
getLat
(),
7
));
Serial
.
println
(
String
(
" lon = "
)
+
String
(
gps
.
getLon
(),
7
));
Serial
.
println
(
String
(
" num sats = "
)
+
String
(
gps
.
getNumberOfSatellites
()));
}
else
{
Serial
.
println
(
"No Fix"
);
}
Serial
.
println
(
String
(
"Delay: "
)
+
msDelay
+
String
(
"ms"
));
delay
(
msDelay
);
}
Ondřej Kučera
@oktkas
mentioned in commit
cfd512ed
·
Jul 29, 2018
mentioned in commit
cfd512ed
mentioned in commit cfd512eddf5148c87e01d74c87548c5a62bdf0e7
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment