From 83b0b0035c9915e3296582992d3620a6555b5673 Mon Sep 17 00:00:00 2001 From: PepperBurst Date: Wed, 23 Sep 2020 22:41:20 +0800 Subject: [PATCH] Fixed soft reset command --- Adafruit_SGP30.cpp | 11 ++++------- Adafruit_SGP30.h | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Adafruit_SGP30.cpp b/Adafruit_SGP30.cpp index 54d60a3..49d0789 100644 --- a/Adafruit_SGP30.cpp +++ b/Adafruit_SGP30.cpp @@ -74,14 +74,11 @@ boolean Adafruit_SGP30::begin(TwoWire *theWire) { * Call" mode. Take note that this is not sensor specific and all devices that * support the General Call mode on the on the same I2C bus will perform this. * - * @return True if command completed successfully, false if something went - * wrong! */ -boolean Adafruit_SGP30::softReset(void) { - uint8_t command[2]; - command[0] = 0x00; - command[1] = 0x06; - return readWordFromCommand(command, 2, 10); +void Adafruit_SGP30::softReset(void) { + _i2c->beginTransmission(0x00); + _i2c->write(0x06); + _i2c->endTransmission(); } /*! diff --git a/Adafruit_SGP30.h b/Adafruit_SGP30.h index 71fbe27..c32e0da 100644 --- a/Adafruit_SGP30.h +++ b/Adafruit_SGP30.h @@ -38,7 +38,7 @@ class Adafruit_SGP30 { public: Adafruit_SGP30(); boolean begin(TwoWire *theWire = &Wire); - boolean softReset(); + void softReset(); boolean IAQinit(); boolean IAQmeasure(); boolean IAQmeasureRaw();