diff options
| author | Luiz Gustavo Monteiro <luizgu_mreis@hotmail.com> | 2025-10-28 20:25:36 -0300 |
|---|---|---|
| committer | Luiz Gustavo Monteiro <luizgu_mreis@hotmail.com> | 2025-10-28 20:25:36 -0300 |
| commit | ba527291e59f1c4cc28b68e4fe119c44a95ab3f6 (patch) | |
| tree | 13c004df31deb7933dc84db818143c459fc87e81 /esp/src/estacao_principal.ino | |
| parent | 6fed254c8033bf4c67b65328474df6807c3b7eb8 (diff) | |
| parent | 7ccab61c22fafb3bb9fa5470ff8cb46217111fe4 (diff) | |
Merge branch 'master' of https://github.com/Simplesmente-O-Grupo/iot-monitoring
Diffstat (limited to 'esp/src/estacao_principal.ino')
| -rw-r--r-- | esp/src/estacao_principal.ino | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/esp/src/estacao_principal.ino b/esp/src/estacao_principal.ino new file mode 100644 index 0000000..65f155c --- /dev/null +++ b/esp/src/estacao_principal.ino @@ -0,0 +1,39 @@ +#include <Wire.h> +#include "dht11.h" +#include "bh1750.h" +#include "bmp280.h" +#include "lm393.h" +#include "as5600.h" + +void setup() { + Serial.begin(115200); + Wire.begin(21, 22); // SDA, SCL + + setupDHT11(); + setupBH1750(); + setupBMP280(); + setupLM393(); + setupAS5600(); + + Serial.println("Estacao iniciada"); +} + +void loop() { + float tempDHT = lerTemperaturaDHT11(); + float umid = lerUmidadeDHT11(); + float lux = lerBH1750(); + float tempBMP = lerTemperaturaBMP280(); + float press = lerPressaoBMP280(); + int pulsos = lerLM393(); + float angulo = lerAS5600(); + + Serial.println("----"); + Serial.print("Umid: "); Serial.print(umid); Serial.println(" %"); + Serial.print("Temp DHT: "); Serial.print(tempDHT); Serial.println(" C"); + Serial.print("Temp BMP: "); Serial.print(tempBMP); Serial.println(" C"); + Serial.print("Pressao: "); Serial.print(press); Serial.println(" hPa"); + Serial.print("Lux: "); Serial.print(lux); Serial.println(" lx"); + Serial.print("Pulsos: "); Serial.println(pulsos); + Serial.print("Angulo: "); Serial.println(angulo); + delay(30000); +} |
