Merge pull request #746 from adafruit/745-update-v1-codebase-to-use-latest-release-of-pm25-library-is_pm1006-flag
Update PM2.5 begin_UART call for PM1006 (PM25AQI v2.0.0)
This commit is contained in:
commit
bcf1d08d58
1 changed files with 5 additions and 2 deletions
|
|
@ -81,14 +81,17 @@ public:
|
|||
/*******************************************************************************/
|
||||
bool begin() override {
|
||||
_aqi = new Adafruit_PM25AQI();
|
||||
bool is_pm1006 = (strcmp(getDriverID(), "pm1006") == 0);
|
||||
#ifdef USE_SW_UART
|
||||
if (!_aqi->begin_UART(
|
||||
_swSerial)) { // connect to the sensor over software serial
|
||||
_swSerial, // connect to the sensor over software serial
|
||||
is_pm1006)) {
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
if (!_aqi->begin_UART(
|
||||
_hwSerial)) { // connect to the sensor over hardware serial
|
||||
_hwSerial, // connect to the sensor over hardware serial
|
||||
is_pm1006)) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue