summaryrefslogtreecommitdiff
path: root/esp/src/dht11.cpp
diff options
context:
space:
mode:
authorLuiz Gustavo Monteiro <luizgu_mreis@hotmail.com>2025-10-28 20:25:36 -0300
committerLuiz Gustavo Monteiro <luizgu_mreis@hotmail.com>2025-10-28 20:25:36 -0300
commitba527291e59f1c4cc28b68e4fe119c44a95ab3f6 (patch)
tree13c004df31deb7933dc84db818143c459fc87e81 /esp/src/dht11.cpp
parent6fed254c8033bf4c67b65328474df6807c3b7eb8 (diff)
parent7ccab61c22fafb3bb9fa5470ff8cb46217111fe4 (diff)
Merge branch 'master' of https://github.com/Simplesmente-O-Grupo/iot-monitoring
Diffstat (limited to 'esp/src/dht11.cpp')
-rw-r--r--esp/src/dht11.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/esp/src/dht11.cpp b/esp/src/dht11.cpp
new file mode 100644
index 0000000..9900363
--- /dev/null
+++ b/esp/src/dht11.cpp
@@ -0,0 +1,18 @@
+#include "DHT.h"
+#include "dht11.h"
+
+#define DHTPIN 32
+#define DHTTYPE DHT11
+DHT dht(DHTPIN, DHTTYPE);
+
+void setupDHT11() {
+ dht.begin();
+}
+
+float lerTemperaturaDHT11() {
+ return dht.readTemperature();
+}
+
+float lerUmidadeDHT11() {
+ return dht.readHumidity();
+}