Hi Folks,
I am working on a project that saves a GPS path on a Teensy3.1 so that it can be compared to a current location. To maintain high accuracy, a large number of the points from the GPS path must be saved.
The issue I am running into is that I am running out of RAM trying to save many points from the GPS path.
I have tried a number of methods to save the data, the first just creating a matrix where the first column was a North position and the second column was an East position.
After reading through the forums a bit, I tried this current method using a data structure.
struct.h:
struct.cpp:
I am trying to save more than 10,000 points because I need a long history of the original track.
Any recommendations?
Thanks.
I am working on a project that saves a GPS path on a Teensy3.1 so that it can be compared to a current location. To maintain high accuracy, a large number of the points from the GPS path must be saved.
The issue I am running into is that I am running out of RAM trying to save many points from the GPS path.
I have tried a number of methods to save the data, the first just creating a matrix where the first column was a North position and the second column was an East position.
After reading through the forums a bit, I tried this current method using a data structure.
Code:
#include "struct.h"
int tmp_N, tmp_E;
void setup() {
Serial.begin(9600);
}
void loop() {
for(int i=0; i<memory; i++)
{
//temporary data for test
tmp_N = 100;
tmp_E = 200;
//assign temporary data into data_array fields
data_array[i].Lnorth = tmp_N;
data_array[i].Least = tmp_E;
delay(100);
Serial.print(data_array[i].Lnorth); Serial.print(" , "); Serial.println(data_array[i].Least);
}
}
struct.h:
Code:
#include <Arduino.h>
const uint16_t memory = 7000;
struct history {
int32_t Lnorth;
int32_t Least;
};
extern history data_array[];
struct.cpp:
Code:
#include "struct.h"
history data_array[memory];
I am trying to save more than 10,000 points because I need a long history of the original track.
Any recommendations?
Thanks.
Last edited: