SHTC3: Wake up the sensor during setup (#993)

Since we put the sensor to sleep when not measuring, make sure to wake
it up during setup.  It does not respond to any other I2C commands
(including reset) while asleep, so if we've done a soft reboot while
it was sleeping then setup() would fail since it wouldn't respond to
anything.
This commit is contained in:
Derek Hageman 2020-04-24 19:10:41 -06:00 committed by GitHub
parent 6123cb7c69
commit c9e224e999
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -25,6 +25,7 @@ inline const char *to_string(SHTCXType type) {
void SHTCXComponent::setup() {
ESP_LOGCONFIG(TAG, "Setting up SHTCx...");
this->wake_up();
this->soft_reset();
if (!this->write_command_(SHTCX_COMMAND_READ_ID_REGISTER)) {