brtaylor
Well-known member
Hi all -
I'm seeing if I can implement an EGM96 geoid model on Teensy 4.x. Specifically, I'm implementing this library:
https://github.com/emericg/EGM96
I renamed the EGM96.c file to a .cpp file and moved the EGM96_data.h to a EGM96_data.cpp file and changed the header file to be:
The data set itself, in the cpp file is declared as:
I'm testing it with the following code:
Compiles fine with the following stats:
The serial monitor continuously flashes on and off - indicating a power cycle of the board. I've tried this on USB power and with an external power supply. Also tried it with Teensy MMOD and Teensy 4.1. Same symptoms on each. Wondering if I'm doing something wrong with PROGMEM since it's my first time using it.
EDIT: attached a zip of the Arduino program.
View attachment sketch_dec14a.zip
I'm seeing if I can implement an EGM96 geoid model on Teensy 4.x. Specifically, I'm implementing this library:
https://github.com/emericg/EGM96
I renamed the EGM96.c file to a .cpp file and moved the EGM96_data.h to a EGM96_data.cpp file and changed the header file to be:
Code:
extern const double egm96_data[65342][4];
The data set itself, in the cpp file is declared as:
Code:
const double egm96_data[65342][4] PROGMEM = {...}
I'm testing it with the following code:
Code:
#include "EGM96.h"
void setup() {
Serial.begin(115200);
while (!Serial) {}
double alt = egm96_compute_altitude_offset(35.691544, -105.944183);
Serial.println(alt);
}
void loop() {}
Compiles fine with the following stats:
Code:
Memory Usage on Teensy MicroMod:
FLASH: code:16420, data:2094936, headers:8316 free for files:14395400
RAM1: variables:28224, code:14720, padding:18048 free for local variables:463296
RAM2: variables:12384 free for malloc/new:511904
The serial monitor continuously flashes on and off - indicating a power cycle of the board. I've tried this on USB power and with an external power supply. Also tried it with Teensy MMOD and Teensy 4.1. Same symptoms on each. Wondering if I'm doing something wrong with PROGMEM since it's my first time using it.
EDIT: attached a zip of the Arduino program.
View attachment sketch_dec14a.zip
Last edited: