Skip to content

Commit

Permalink
Merge pull request #5 from akkoyun/03.02.05
Browse files Browse the repository at this point in the history
03.02.05 - Statistical function update
  • Loading branch information
akkoyun authored Feb 11, 2022
2 parents dd573a9 + 576eab9 commit 6ab41b6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Environment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ float Environment::SHT21_Temperature(const uint8_t Read_Count_, const uint8_t Av
// Calculate Data
uint16_t _Data_Size = sizeof(Measurement_Array) / sizeof(Measurement_Array[0]);
Value_ = Stats.Array_Average(Measurement_Array, _Data_Size, Average_Type_);
Stats.Array_Statistic_Clear();

// ************************************************************
// Control For Sensor Range
Expand Down Expand Up @@ -274,6 +275,7 @@ float Environment::SHT21_Humidity(const uint8_t Read_Count_, const uint8_t Avera
// Calculate Data
uint16_t _Data_Size = sizeof(Measurement_Array) / sizeof(Measurement_Array[0]);
Value_ = Stats.Array_Average(Measurement_Array, _Data_Size, Average_Type_);
Stats.Array_Statistic_Clear();

// ************************************************************
// Control For Sensor Range
Expand Down Expand Up @@ -503,6 +505,7 @@ float Environment::HDC2010_Temperature(const uint8_t Read_Count_, const uint8_t
// Calculate Data
uint16_t _Data_Size = sizeof(Measurement_Array) / sizeof(Measurement_Array[0]);
Value_ = Stats.Array_Average(Measurement_Array, _Data_Size, Average_Type_);
Stats.Array_Statistic_Clear();

// ************************************************************
// Control For Sensor Range
Expand Down Expand Up @@ -731,6 +734,7 @@ float Environment::HDC2010_Humidity(const uint8_t Read_Count_, const uint8_t Ave
// Calculate Data
uint16_t _Data_Size = sizeof(Measurement_Array) / sizeof(Measurement_Array[0]);
Value_ = Stats.Array_Average(Measurement_Array, _Data_Size, Average_Type_);
Stats.Array_Statistic_Clear();

// ************************************************************
// Control For Sensor Range
Expand Down Expand Up @@ -1412,6 +1416,7 @@ float Environment::MCP3422_Pressure(const uint8_t _Channel, const uint8_t _Read_
// Calculate Data
float _Value = (Stats.Array_Average(Pressure_RAW_Array, _Read_Count, _Average_Type) * _Sensor_Max);
_Value = (_Value * 1.5304) - 1.3437;
Stats.Array_Statistic_Clear();

// End Function
return(_Value);
Expand Down

0 comments on commit 6ab41b6

Please sign in to comment.