mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-07-18 03:02:10 +02:00
Ignore parameter values out of range #190
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
#include "PMS5003.h"
|
||||
#include "Arduino.h"
|
||||
#include "../Main/utils.h"
|
||||
|
||||
#if defined(ESP8266)
|
||||
#include <SoftwareSerial.h>
|
||||
@ -87,28 +88,30 @@ bool PMS5003::begin(void) {
|
||||
*
|
||||
* @return int PM1.0 index
|
||||
*/
|
||||
int PMS5003::getPm01Ae(void) { return pms.getPM0_1(); }
|
||||
int PMS5003::getPm01Ae(void) { return utils::correctPMS(pms.getPM0_1()); }
|
||||
|
||||
/**
|
||||
* @brief Read PM2.5 must call this function after @ref readData success
|
||||
*
|
||||
* @return int PM2.5 index
|
||||
*/
|
||||
int PMS5003::getPm25Ae(void) { return pms.getPM2_5(); }
|
||||
int PMS5003::getPm25Ae(void) { return utils::correctPMS(pms.getPM2_5()); }
|
||||
|
||||
/**
|
||||
* @brief Read PM10.0 must call this function after @ref readData success
|
||||
*
|
||||
* @return int PM10.0 index
|
||||
*/
|
||||
int PMS5003::getPm10Ae(void) { return pms.getPM10(); }
|
||||
int PMS5003::getPm10Ae(void) { return utils::correctPMS(pms.getPM10()); }
|
||||
|
||||
/**
|
||||
* @brief Read PM0.3 must call this function after @ref readData success
|
||||
*
|
||||
* @return int PM0.3 index
|
||||
*/
|
||||
int PMS5003::getPm03ParticleCount(void) { return pms.getCount0_3(); }
|
||||
int PMS5003::getPm03ParticleCount(void) {
|
||||
return utils::correctPMS(pms.getCount0_3());
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Convert PM2.5 to US AQI
|
||||
|
Reference in New Issue
Block a user