Compensate soldering offset for barometer/thermometer
This commit is contained in:
parent
6a8399f95c
commit
3128b41aa6
1 changed files with 9 additions and 3 deletions
12
src/main.c
12
src/main.c
|
@ -5,6 +5,11 @@
|
|||
#include "minmea.h"
|
||||
|
||||
//#define HZ2MS(X) ((uint64_t)((X * 53000.0)/(SystemCoreClock)))
|
||||
//
|
||||
#define BMP180_SOLDERING_OFF_T 190
|
||||
#define BMP180_SOLDERING_OFF_P 12050
|
||||
|
||||
|
||||
|
||||
|
||||
void init_uart0(void)
|
||||
|
@ -412,9 +417,6 @@ int main(void)
|
|||
/* Read calibration registers */
|
||||
bmp180_calibrate();
|
||||
|
||||
|
||||
|
||||
|
||||
while (1)
|
||||
{
|
||||
read_gps(&gps_data);
|
||||
|
@ -430,6 +432,10 @@ int main(void)
|
|||
LCD_ShowString(0, 48, (u8 *)(prs), GREEN);
|
||||
LCD_ShowString(0, 64, (u8 *)(tmp), GREEN);
|
||||
|
||||
/* Device offset */
|
||||
ut -= BMP180_SOLDERING_OFF_T;
|
||||
up -= BMP180_SOLDERING_OFF_P;
|
||||
|
||||
temperature = compensate_temperature(ut);
|
||||
pressure = compensate_pressure(up);
|
||||
snprintf(tmp, MAX_ROW - 1, "T: %d", temperature);
|
||||
|
|
Loading…
Reference in a new issue