mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-07-15 17:52:08 +02:00
Set S8 Automatic Baseline Period
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
#include "AirGradient.h"
|
||||
|
||||
#define AG_LIB_VER "2.5.0"
|
||||
#define AG_LIB_VER "3.0.0"
|
||||
|
||||
AirGradient::AirGradient(BoardType type)
|
||||
: pms5003(type), pms5003t_1(type), pms5003t_2(type), s8(type), sht4x(type),
|
||||
|
@ -793,3 +793,23 @@ void S8::sendCommand(uint8_t func, uint16_t reg, uint16_t value) {
|
||||
uartWriteBytes(8);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set Auto calib baseline period
|
||||
*
|
||||
* @param hours Number of hour will trigger auto calib: [0, 4800], 0: disable
|
||||
* @return true Success
|
||||
* @return false Failure
|
||||
*/
|
||||
bool S8::setAutoCalib(int hours) {
|
||||
if (isBegin() == false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int curCalib = getCalibPeriodABC();
|
||||
if (curCalib == hours) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return setCalibPeriodABC(hours);
|
||||
}
|
||||
|
@ -78,6 +78,7 @@ public:
|
||||
int16_t getCo2(void);
|
||||
bool setBaselineCalibration(void);
|
||||
bool isBaseLineCalibrationDone(void);
|
||||
bool setAutoCalib(int hours);
|
||||
|
||||
private:
|
||||
/** Variables */
|
||||
|
Reference in New Issue
Block a user