forked from SlashDevin/NeoGPS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNMEAblink.ino
69 lines (60 loc) · 2.04 KB
/
NMEAblink.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include <NMEAGPS.h>
//======================================================================
// Program: NMEAblink.ino
//
// Prerequisites:
// 1) NMEA.ino works with your device
//
// Description: This program will toggle the LED once per second,
// when the LAST_SENTENCE_IN_INTERVAL is received.
//
// Because no actual GPS data is used, you could disable all
// messages (except the LAST_SENTENCE) and all gps_fix members.
// It would still receive a 'fix' oncer per second, without
// without using any RAM or CPU time to parse or save
// the (unused) values. Essentially, this app uses the LAST_SENTENCE
// as a 1PPS signal.
//
// Note: Because this example does not use 'Serial', you
// could use 'Serial' for the gpsPort, like this:
//
// #define gpsPort Serial
//
// See GPSport.h for more information.
//
// License:
// Copyright (C) 2014-2017, SlashDevin
//
// This file is part of NeoGPS
//
// NeoGPS is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// NeoGPS is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with NeoGPS. If not, see <http://www.gnu.org/licenses/>.
//
//======================================================================
#include <GPSport.h>
static NMEAGPS gps;
static const int led = 13;
//--------------------------
void setup()
{
gpsPort.begin(9600);
pinMode(led, OUTPUT);
}
//--------------------------
void loop()
{
if (gps.available( gpsPort)) {
gps.read(); // don't really do anything with the fix...
digitalWrite( led, !digitalRead(led) ); // toggle the LED
}
}