Hi Gordon,
in this project we are trying transmit GPS data on "NRF"... this is the script which i am using.
var data=command.test();
var arr = [];
data+=command.gps();
eval(data);
eval(Modvar.nrf());
Serial2.setup(9600);
Serial5.setup(9600);
Serial5.on('data', function (data) { print(+data); });
function onInit(){nrf.init([0,0,0,0,2],[0,0,0,0,1]);}
onInit();
setInterval(function() {
nrf.masterHandler();
// print(process.memory());
}, 50);
function nrf_print(data){
// var i =nrf.sendString("\n"+data);
print("result :"+data);
}
//eval(command.gps());
var gps =ConnectGps(Serial2, function(data) {
if(data.tag == "GGA")
{
console.log("\r\n lat:" +data.lat);
console.log("\r\n lon:" +data.lon);
console.log("\r\n fix:" +data.fix);
// lat
arr[6] = parseInt(data.lat[0],10)*10 + parseInt(data.lat[1],10);
arr[7] = parseInt(data.lat[3],10)*10 + parseInt(data.lat[4],10);
arr[8] = parseInt(data.lat[5],10)*10 + parseInt(data.lat[6],10);
// lon
arr[9] = parseInt(data.lon[0],10)*10 + parseInt(data.lon[1],10);
arr[10] = parseInt(data.lon[3],10)*10 + parseInt(data.lon[4],10);
arr[11] = parseInt(data.lon[5],10)*10 + parseInt(data.lon[6],10);
}
else if(data.tag == "RMC")
{
console.log("\r\n time:" +data.time);
console.log("\r\n date:" +data.date);
console.log("\r\n speed:" +data.speed);
console.log("\r\n valid:" +data.valid);
console.log("\r\n course:" +data.course);
// time
arr[0] = parseInt(data.time[0],10)*10 + parseInt(data.time[1],10);
arr[1] = parseInt(data.time[3],10)*10 + parseInt(data.time[4],10);
arr[2] = parseInt(data.time[7],10)*10 + parseInt(data.time[8],10);
// date
arr[3] = parseInt(data.date[0],10)*10 + parseInt(data.date[1],10);
arr[4] = parseInt(data.date[3],10)*10 + parseInt(data.date[4],10);
arr[5] = parseInt(data.date[7],10)*10 + parseInt(data.date[8],10);
// valid
arr[12] = data.valid[0];
// speed
arr[13] = parseInt(data.speed,10);
nrf_print(arr);
}
});
in this
nrf_print(arr);
if i changed this one to static data like nrf_print("Helloworld"); there is no problem with memory... i think this "arr "array is creating some problem...
Thanks
Vishnu
Hi Gordon,
in this project we are trying transmit GPS data on "NRF"... this is the script which i am using.
in this
if i changed this one to static data like nrf_print("Helloworld"); there is no problem with memory... i think this "arr "array is creating some problem...
Thanks
Vishnu