rv701 / SPL06-007

Ardino SPL06-007 Library
12 stars 7 forks source link

Altitude nan #8

Open HGTechNZ opened 2 years ago

HGTechNZ commented 2 years ago

Here is what I am getting in the serial monitor:

ID: 16 PRS_CFG: 11 TMP_CFG: 10000011 MEAS_CFG: 11110111 CFG_REG: 0 INT_STS: 0 FIFO_STS: 0 c0: 204 c1: -259 c00: 79984 c10: 991617 c01: -2515 c11: 1070 c20: -9945 c21: -4 c30: -1304 Local Airport Sea Level Pressure: 1011.30 mb altitude: nan m altitude: nan ft

Why is my altitude nan?

Using Arduino Uno.

barry-ha commented 2 years ago

"NaN" is "not a number". It sounds like something in the combination of these measurements and coefficients causes the arithmetic to fail. For example, a square root of a negative number or dividing by zero will result in NaN. Good luck.

LivingInfoSystems commented 1 year ago

For me, Serial.print(get_pressure()); is reporting a -ve number, -3785.51mb, for example. Serial.print(get_altitude(get_pressure(),local_pressure),1) uses that pressure (invalid result) to calculate the altitude, so also returns an invalid result. I'm working on how to get a valid result from Serial.print(get_pressure()); I'm looking for a calibration step.

M.