forked from dfannin/arduino-vx8r-gps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathYgps.ino
38 lines (29 loc) · 775 Bytes
/
Ygps.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
// Copyright (c) 2014 David Fannin. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE.txt file.
//
// Version 1.0
#include <AltSoftSerial.h>
#include "GpsDevice.h"
AltSoftSerial gpsserial;
GpsDevice gps(gpsserial);
void setup() {
Serial.begin(9600);
gps.begin(9600);
}
void loop(){
char c ;
gps.read(); // read a character from gps
// if parsed, filtered message is available, send it to the Yaesu
if(gps.isAvailable()) {
// make sure the checksum is valid
if (gps.valid() ) {
Serial.println(gps.msg);
}
}
// send yaesu output to the gps
if(Serial.available()) {
c = Serial.read();
gps.write(c);
}
}