5 #include "oXs_config_basic.h"
6 #include "oXs_config_advanced.h"
7 #include "oXs_config_macros.h"
10 //#define CALCULATEINTEGER
13 // float smoothDifPressureAdc ; // in steps ADC
14 float temperature4525
; // in Celsius , used when compensation is calculated
15 // float rawAirSpeed ; // cm/sec
16 struct ONE_MEASUREMENT airSpeed
; // in km/h (no decimal)
17 // int32_t compensation ; // in km/h (no decimal)
18 // bool compensationAvailable ;
20 float smoothAirSpeed
; //cm/sec ; use in glider ratio
21 unsigned long lastCommand2Micros
; // used to avoid some task (reading voltage sensor, currentsensor, ..) when barometric data should be soon available for reading
22 // = micro divided by 2 to avoid overflow on comparison
23 float difPressureAdc_zero
;
26 extern float actualPressure
;
31 OXS_4525(uint8_t addr
, HardwareSerial
&print
);
33 OXS_4525(uint8_t addr
) ;
35 AIRSPEEDDATA airSpeedData
;
36 // int64_t rawPressure; // in 1/10000 mBar
43 // unsigned int _calibrationData[7]; // The factory calibration data of the ms5611
45 void SendCommand(byte command
);
47 uint8_t I2CErrorCode4525
;
48 long getData(byte command
, byte del
);
50 int calibrateCount4525
;
51 int32_t difPressureSum
;
53 // unsigned long extended2Micros ; // used to temporarilly save micros() >> 1
54 uint8_t data
[4]; // get the 4 bytes returned by MS4225
55 int32_t difPressureAdc
; // in steps ADC
56 int32_t temperature4525Adc
; // in steps ADC
59 float difPressureAdc_0
;
60 float abs_deltaDifPressureAdc
;
61 float smoothDifPressureAdc
; // in steps ADC/
63 float expoSmooth4525_adc_auto
;
64 // float smoothAirSpeed ; //cm/sec
65 // float rawAirSpeed ; // cm/sec
67 unsigned long airSpeedMillis
; //save time when airspeed is made available
68 unsigned long nextAirSpeedMillis
; //next time that airspeed must be available
71 HardwareSerial
* printer
;
73 }; // end class OXS_4525
75 extern int32_t test1Value
;// used in order to test the transmission of any value
76 extern bool test1ValueAvailable
;
77 extern int32_t test2Value
;// used in order to test the transmission of any value
78 extern bool test2ValueAvailable
;
79 extern int32_t test3Value
;// used in order to test the transmission of any value
80 extern bool test3ValueAvailable
;