ESP8266传感器集合arduino-GY-BMP280-3.3高精度大气压强传感器模块

效果图

截屏2022-11-06 21.34.27.png

应该是国产盗版,正版应该是

https://www.adafruit.com/product/2652

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <Arduino.h>

#include <Wire.h>
#include <SPI.h>
#include <Adafruit_Sensor.h>
#include "Adafruit_BMP280.h" //#这个东西找卖家要,或者文章地步下载

Adafruit_BMP280 bme; // I2C


void setup() {

// write your initialization code here
Serial.begin(115200);

unsigned status;
status = bme.begin();

if (!status) {
Serial.println("Could not find a valid BMP280 sensor, check wiring!");
while (1) delay(10);
}

}

void loop() {
Serial.print("温度 = ");
Serial.print(bme.readTemperature());
Serial.println(" C");

Serial.print("气压 = ");
Serial.print(bme.readPressure());
Serial.println(" Pa");

// Serial.print("Approx altitude = ");
// Serial.print(bme.readAltitude(1013.25)); // this should be adjusted to your local forcase
// Serial.println(" m");

Serial.println();
delay(2000);
}

GY-BMP280-3.3 高精度大气压强传感器模块 高度计传感器模块大气.zip

作者

舰长胡椒

发布于

2022-11-06

更新于

2023-10-13

许可协议

评论