FIX: DHT22 Adafruit: added missing setup call
This commit is contained in:
parent
da31e2d40a
commit
528c12c70f
@ -37,10 +37,10 @@ lib_deps = ${common.lib_deps}
|
||||
build_flags = ${common.build_flags} -DNODE_GREENHOUSE -DHOSTNAME=\"Greenhouse\"
|
||||
board_build.filesystem = ${common.board_build.filesystem}
|
||||
monitor_speed = ${common.monitor_speed}
|
||||
;upload_protocol = ${common.upload_protocol}
|
||||
;upload_port = 10.0.0.160
|
||||
upload_port = ${common.upload_port}
|
||||
upload_speed = ${common.upload_speed}
|
||||
upload_protocol = ${common.upload_protocol}
|
||||
upload_port = 10.0.0.160
|
||||
;upload_port = ${common.upload_port}
|
||||
;upload_speed = ${common.upload_speed}
|
||||
|
||||
[env:Fermenter]
|
||||
platform = ${esp12e.platform}
|
||||
@ -52,6 +52,6 @@ board_build.filesystem = ${common.board_build.filesystem}
|
||||
monitor_speed = ${common.monitor_speed}
|
||||
upload_flags = --auth=OtaAuthPatrixFermenter
|
||||
upload_protocol = ${common.upload_protocol}
|
||||
upload_port = 10.0.0.169
|
||||
upload_port = 10.0.0.164
|
||||
;upload_port = ${common.upload_port}
|
||||
;upload_speed = ${common.upload_speed}
|
||||
|
||||
@ -9,6 +9,7 @@ DHT22Sensor greenhouseDHT22("greenhouse", D5);
|
||||
|
||||
void patrixSetup() {
|
||||
greenhouseTSL.setup();
|
||||
greenhouseDHT22.setup();
|
||||
}
|
||||
|
||||
void patrixLoop() {
|
||||
|
||||
@ -24,12 +24,13 @@ public:
|
||||
|
||||
void setup() {
|
||||
dht.begin();
|
||||
last = millis();
|
||||
}
|
||||
|
||||
void loop() {
|
||||
const auto now = max(1UL, millis());
|
||||
float temperature = NAN;
|
||||
if (last == 0 || now - last >= intervalMs) {
|
||||
if (now - last >= intervalMs) {
|
||||
sensors_event_t event;
|
||||
|
||||
dht.temperature().getEvent(&event);
|
||||
@ -50,7 +51,7 @@ public:
|
||||
mqttPublishValue(name + "/humidity/absolute", absHumid, "HUMIDITY_ABSOLUTE_GM3");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
last = now;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user