diff options
| author | Gustavoeklund01 <eklundgu@gmail.com> | 2025-10-27 19:15:23 -0300 |
|---|---|---|
| committer | Gustavoeklund01 <eklundgu@gmail.com> | 2025-10-27 19:15:23 -0300 |
| commit | 4008253dfd2005da102f6da06389268ecef152f6 (patch) | |
| tree | d8e7efa5262fcd212a0a30d647dcf12eb742fab2 /esp/BMP280.ino | |
| parent | f8b53f993ac61e470bcc1ee321c16a0657cf161d (diff) | |
conciliação dos sensores do esp32
Diffstat (limited to 'esp/BMP280.ino')
| -rw-r--r-- | esp/BMP280.ino | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/esp/BMP280.ino b/esp/BMP280.ino deleted file mode 100644 index 417edb1..0000000 --- a/esp/BMP280.ino +++ /dev/null @@ -1,29 +0,0 @@ -#include <Wire.h> -#include <Adafruit_Sensor.h> -#include <Adafruit_BMP280.h> - -Adafruit_BMP280 bmp; // cria o objeto do sensor - -void setup() { - Serial.begin(115200); - Wire.begin(21, 22); // SDA e SCL - Serial.println("Teste do Sensor BMP280 - Pressão e Temperatura"); - - if (!bmp.begin(0x76)) { // endereço I2C padrão - Serial.println("Erro: BMP280 não encontrado!"); - while (1); - } -} - -void loop() { - float temp = bmp.readTemperature(); - float press = bmp.readPressure() / 100.0F; // converte Pa para hPa - - Serial.print("Temperatura: "); - Serial.print(temp); - Serial.print(" °C | Pressão: "); - Serial.print(press); - Serial.println(" hPa"); - - delay(2000); // leitura a cada 2 segundos -}
\ No newline at end of file |
