bool scd4x_power_down() {
Wire.beginTransmission(SCD4x_ADDRESS);
Wire.write(0x36);
Wire.write(0xE0);
int error = Wire.endTransmission();
if (error) {
return error;
}
delayMicroseconds(1000); // Sleep for 1000 microseconds
return (true);
}
int16_t scd4x_wake_up() {
Wire.beginTransmission(SCD4x_ADDRESS);
Wire.write(0x36);
Wire.write(0xF6);
(void)Wire.endTransmission(); // Ignore the error as per the original function
delay(20); // Sleep for 20 milliseconds
return (true);
}
I've attempted to add the sleep\wake feature: https://github.com/chinswain/SparkFun_SCD4x_Arduino_Library
added to .h
added to .cpp
Docs: https://sensirion.com/media/documents/E0F04247/631EF271/CD_DS_SCD40_SCD41_Datasheet_D1.pdf