-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from 1oginov/dev
Release v1.4.0
- Loading branch information
Showing
14 changed files
with
292 additions
and
211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"C_Cpp.default.defines": [ | ||
// Fixes `Serial1`, `Serial2`, `Serial3` undefined. | ||
"UBRR1H", | ||
"UBRR2H", | ||
"UBRR3H", | ||
// Fixes `Serial` undefined. | ||
"USBCON", | ||
], | ||
"C_Cpp.default.includePath": [ | ||
// Fixes `Arduino.h` and related headers undefined. | ||
"C:/Program Files (x86)/Arduino/hardware/arduino/avr/cores/arduino", | ||
"C:/Program Files (x86)/Arduino/hardware/arduino/avr/variants/standard", | ||
"C:/Program Files (x86)/Arduino/hardware/tools/avr/avr/include", | ||
"C:/Program Files (x86)/Arduino/hardware/tools/avr/lib/gcc/avr/5.4.0/include", | ||
// Fixes `SoftwareSerial.h` undefined. | ||
"C:/Program Files (x86)/Arduino/hardware/arduino/avr/libraries/SoftwareSerial/src", | ||
// Fixes library files undefined. | ||
"${workspaceFolder}/src", | ||
], | ||
"editor.rulers": [ | ||
120, | ||
], | ||
"editor.tabSize": 4, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/** | ||
* The sketch parses UBX messages from u-blox NEO-7M and outputs ready GPS data to a serial port in a CSV format. | ||
* | ||
* u-blox NEO-7M - Arduino Uno | ||
* VCC - 5V | ||
* RX - 3 | ||
* TX - 2 | ||
* GND - GND | ||
*/ | ||
|
||
#include <Arduino.h> | ||
#include <SoftwareSerial.h> | ||
#include <UbxGpsNavPvt.h> | ||
|
||
#define GPS_BAUDRATE 115200L | ||
#define GPS_RX 3 | ||
#define GPS_TX 2 | ||
#define PC_BAUDRATE 115200L | ||
|
||
#define DATETIME_FORMAT "%04d.%02d.%02d %02d:%02d:%02d" | ||
#define DATETIME_LENGTH 20 | ||
|
||
SoftwareSerial ss(GPS_TX, GPS_RX); | ||
UbxGpsNavPvt<SoftwareSerial> gps(ss); | ||
|
||
char datetime[DATETIME_LENGTH]; | ||
|
||
void setup() | ||
{ | ||
Serial.begin(PC_BAUDRATE); | ||
gps.begin(GPS_BAUDRATE); | ||
} | ||
|
||
void loop() | ||
{ | ||
if (gps.ready()) | ||
{ | ||
snprintf(datetime, DATETIME_LENGTH, DATETIME_FORMAT, gps.year, gps.month, gps.day, gps.hour, gps.min, gps.sec); | ||
|
||
Serial.print(datetime); | ||
Serial.print(','); | ||
Serial.print(gps.lon / 10000000.0, 7); | ||
Serial.print(','); | ||
Serial.print(gps.lat / 10000000.0, 7); | ||
Serial.print(','); | ||
Serial.print(gps.height / 1000.0, 3); | ||
Serial.print(','); | ||
Serial.print(gps.gSpeed * 0.0036, 5); | ||
Serial.print(','); | ||
Serial.print(gps.heading / 100000.0, 5); | ||
Serial.print(','); | ||
Serial.print(gps.fixType); | ||
Serial.print(','); | ||
Serial.println(gps.numSV); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.