Hi guys!
I want to get the speed and, depending on it do an actions, for example, to light the LED.
I see 2 ways of solving this problem. the first one
Use the standard Esprino library, taken from the link below. https://www.espruino.com/GPS
Serial3.setup (115200, {rx: P0, tx: P1});
var gps = require ("GPS"). connect (Serial3, function (data) {
console.log (data);
});
There is no speed but I can get it if i know Time1 and Time0 and latitude, longitude at Time1, Time0.
I can colculat the distance pased using formulas from there http://www.movable-type.co.uk/scripts/latlong.html.
, then devide it on diff betvin T1 and T0
The problem is
How get latitude, longitude at T1, T0 from this code?
Serial3.setup (115200, {rx: P0, tx: P1});
var gps = require ("GPS"). connect (Serial3, function (data) {
console.log (data);
});
if i try somth like this
Serial3.setup(115200, {rx: P0, tx: P1});
var gps = require("GPS").connect(Serial3, function(data) {
T1=data;
return T1;
})
console.log(gps)enter code here
i get empty valus in console.
. the second way is to communicate with serial
I use such cod
Serial3.setup (115200, {rx: P0, tx: P1});
var bufer = '';
Serial3.on ('data', function (data) {
bufer + = data;
var lines = bufer.split ('$');
bufer = lines [lines.length-1];
if (lines.length> 1) {
for (l = 0; l <lines.length-1; l ++) {print (lines [l]);}}});
Problem
As a result, it get all data from GPS controller but here http://www.gpsinformation.org/dale/nmea.htm
I have not found any messages with such codes, and accordingly I do not understand what position, what it means, and how it's to pars it to get the speed. How to pars the
NMEA sentent ?
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hi guys!
I want to get the speed and, depending on it do an actions, for example, to light the LED.
I see 2 ways of solving this problem.
the first one
Use the standard Esprino library, taken from the link below.
https://www.espruino.com/GPS
The following data is displayed:
There is no speed but I can get it if i know Time1 and Time0 and latitude, longitude at Time1, Time0.
I can colculat the distance pased using formulas from there http://www.movable-type.co.uk/scripts/latlong.html.
, then devide it on diff betvin T1 and T0
The problem is
How get latitude, longitude at T1, T0 from this code?
Serial3.setup (115200, {rx: P0, tx: P1});
var gps = require ("GPS"). connect (Serial3, function (data) {
console.log (data);
});
if i try somth like this
i get empty valus in console.
.
the second way is to communicate with serial
I use such cod
Problem
As a result, it get all data from GPS controller but here http://www.gpsinformation.org/dale/nmea.htm
I have not found any messages with such codes, and accordingly I do not understand what position, what it means, and how it's to pars it to get the speed. How to pars the
NMEA sentent ?