Тема: bme280
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_BME280.h> // https://github.com/adafruit/Adafruit_BME280_Library
#include <Adafruit_Sensor.h> // https://github.com/adafruit/Adafruit_Sensor
Adafruit_BME280 bme;
float t,hpa,h;
void setup(){
Serial.begin(9600);
if (!bme.begin(0x76)) {
Serial.println("Could not find a valid BME280!"); while (1);}
}
void loop(){
t = bme.readTemperature();
hpa = bme.readPressure() / 100.0F;
h = bme.readHumidity();
Serial.print("T ");
Serial.println(t,1);
Serial.print("P ");
Serial.println(hpa*0.750061682,1);
Serial.print("H ");
Serial.println(h,1);
delay(1000);
}