Repeater, room server, sensor, companion: an SHTC3 sleeps from boot, not only after its first read
Changelog-cs: Repeater, room server, senzor, companion: čidlo SHTC3 spí od startu, ne až po prvním čtení Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a7a39126ac
commit
36c6632aaa
2 files changed
+15
-6
No files matched your search
@@ -225,7 +225,8 @@ static void scanI2CBus(TwoWire* wire, bool found[128]) {
|
||||
// forced) conversion per query; power-down keeps the configuration. On a 0.5 W
|
||||
// solar node in December a single INA219 was 15-20 % of the budget. The ones
|
||||
// not touched already sleep on their own (BME280 forced, BME680 performReading,
|
||||
// SHTC3, SHT4x, AHTX0, LPS22HB one-shot, BMP085). Idea and first patch (INA219):
|
||||
// SHT4x, AHTX0, LPS22HB one-shot, BMP085; SHTC3 only after its first read, so
|
||||
// it is sent to sleep right after init). Idea and first patch (INA219):
|
||||
// Alkel Brostl.
|
||||
|
||||
#if ENV_INCLUDE_AHTX0
|
||||
@@ -303,7 +304,11 @@ static void query_bmp280(uint8_t ch, uint8_t, CayenneLPP& lpp) {
|
||||
#if ENV_INCLUDE_SHTC3
|
||||
static uint8_t init_shtc3(TwoWire* wire, uint8_t) {
|
||||
// Adafruit_SHTC3::begin() does not accept an address (fixed at 0x70).
|
||||
return SHTC3.begin(wire) ? 1 : 0;
|
||||
if (!SHTC3.begin(wire)) return 0;
|
||||
// CUSTOM (TeTeHacko): begin() wakes it and leaves it idle (~45 uA) until the
|
||||
// first read, after which getEvent() puts it back to sleep (~0.3 uA) on its own.
|
||||
SHTC3.sleep(true);
|
||||
return 1;
|
||||
}
|
||||
static void query_shtc3(uint8_t ch, uint8_t, CayenneLPP& lpp) {
|
||||
sensors_event_t humidity, temp;
|
||||
|
||||
Reference in new issue
Block a user