-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7dc1c6f
commit faddeec
Showing
7 changed files
with
177 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
******************************************************************************* | ||
* Copyright (c) 2022 by M5Stack | ||
* Equipped with M5Core sample source code | ||
* 配套 M5Core 示例源代码 | ||
* Visit for more information: https://docs.m5stack.com/en/unit/bps | ||
* 获取更多资料请访问: https://docs.m5stack.com/zh_CN/unit/bps | ||
* | ||
* Product: BPS_BMP280. 气压计 | ||
* Date: 2022/8/18 | ||
******************************************** *********************************** | ||
Please connect to Port A(22、21),Read atmospheric pressure and temperature and | ||
display them on the display screen | ||
请连接端口A(22、21),读取大气压强和温度并在显示屏上显示 | ||
*/ | ||
|
||
#include <M5Stack.h> | ||
#include <Adafruit_BMP280.h> | ||
|
||
Adafruit_BMP280 bme; | ||
|
||
void setup() { | ||
M5.begin(); // Init M5Stack. 初始化M5Stack | ||
M5.Power.begin(); // Init power 初始化电源模块 | ||
M5.Lcd.setTextSize(2); //设置字体大小为2. Set the font size to 2 | ||
Wire.begin(); // Wire init, adding the I2C bus. Wire初始化, 加入i2c总线 | ||
while (!bme.begin( | ||
0x76)) { // Init this sensor,True if the init was successful, otherwise | ||
// false. 初始化传感器,如果初始化成功返回1 | ||
M5.Lcd.println("Could not find a valid BMP280 sensor, check wiring!"); | ||
} | ||
M5.Lcd.clear(); // Clear the screen. 清屏 | ||
} | ||
|
||
float pressure, | ||
Temp; // Store the vuale of pressure and Temperature. 存储压力和温度 | ||
|
||
void loop() { | ||
pressure = bme.readPressure(); | ||
Temp = bme.readTemperature(); | ||
M5.Lcd.setCursor(0, 0); //将光标设置在(0 ,0). Set the cursor to (0,0) | ||
M5.Lcd.printf("Pressure:%2.0fPa\nTemperature:%2.0f^C", pressure, Temp); | ||
delay(100); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
******************************************************************************* | ||
* Copyright (c) 2022 by M5Stack | ||
* Equipped with M5Core2 sample source code | ||
* 配套 M5Core2 示例源代码 | ||
* Visit for more information: https://docs.m5stack.com/en/unit/bps | ||
* 获取更多资料请访问: https://docs.m5stack.com/zh_CN/unit/bps | ||
* | ||
* Product: BPS_BMP280. 气压计 | ||
* Date: 2022/8/18 | ||
******************************************** *********************************** | ||
Please connect to Port A(22、21),Read atmospheric pressure and temperature and | ||
display them on the display screen | ||
请连接端口A(22、21),读取大气压强和温度并在显示屏上显示 | ||
*/ | ||
|
||
#include <M5Core2.h> | ||
#include <Adafruit_BMP280.h> | ||
|
||
Adafruit_BMP280 bme; | ||
|
||
void setup() { | ||
M5.begin(); // Init M5Core2. 初始化 M5Core2 | ||
Wire.begin(); // Wire init, adding the I2C bus. Wire初始化, 加入i2c总线 | ||
while (!bme.begin( | ||
0x76)) { // Init this sensor,True if the init was successful, otherwise | ||
// false. 初始化传感器,如果初始化成功返回1 | ||
M5.Lcd.println("Could not find a valid BMP280 sensor, check wiring!"); | ||
} | ||
M5.Lcd.clear(); // Clear the screen. 清屏 | ||
} | ||
|
||
float pressure, | ||
Temp; // Store the vuale of pressure and Temperature. 存储压力和温度() | ||
|
||
void loop() { | ||
pressure = bme.readPressure(); | ||
Temp = bme.readTemperature(); | ||
M5.Lcd.setCursor(0, 0); //将光标设置在(0 ,0). Set the cursor to (0,0) | ||
M5.Lcd.setTextSize(3); //设置字体大小为3. Set the font size to 3 | ||
M5.Lcd.printf("Pressure:%2.0fPa\nTemperature:%2.0f^C", pressure, Temp); | ||
delay(100); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
******************************************************************************* | ||
* Copyright (c) 2021 by M5Stack | ||
* Equipped with M5StickC sample source code | ||
* 配套 M5StickC 示例源代码 | ||
* Visit for more information: https://docs.m5stack.com/en/unit/bps | ||
* 获取更多资料请访问: https://docs.m5stack.com/zh_CN/unit/bps | ||
* | ||
* Product: BPS_BMP280. 气压计 | ||
* Date: 2022/8/18 | ||
******************************************** *********************************** | ||
Please connect to Port,Read atmospheric pressure and temperature and display | ||
them on the display screen 请连接端口,读取大气压强和温度并在显示屏上显示 | ||
*/ | ||
#include <M5StickC.h> | ||
#include <Adafruit_BMP280.h> | ||
|
||
Adafruit_BMP280 bme; | ||
|
||
void setup() { | ||
M5.begin(); // Init M5StickC. 初始化 M5StickC | ||
M5.Lcd.setRotation(3); // Rotate the screen. 旋转屏幕 | ||
Wire.begin(); // Wire init, adding the I2C bus. Wire初始化, 加入i2c总线 | ||
while (!bme.begin( | ||
0x76)) { // Init this sensor,True if the init was successful, otherwise | ||
// false. 初始化传感器,如果初始化成功返回1 | ||
M5.Lcd.println("Could not find a valid BMP280 sensor, check wiring!"); | ||
} | ||
M5.Lcd.fillScreen(BLACK); // Clear the screen. 清屏 | ||
} | ||
|
||
float pressure, | ||
Temp; // Store the vuale of pressure and Temperature. 存储压力和温度() | ||
|
||
void loop() { | ||
pressure = bme.readPressure(); | ||
Temp = bme.readTemperature(); | ||
M5.Lcd.setCursor(0, 0); //将光标设置在(0 ,0). Set the cursor to (0,0) | ||
M5.Lcd.setTextSize(2); //设置字体大小为2. Set the font size to 2 | ||
M5.Lcd.printf("Pre:%2.0fPa\nTem:%2.0f^C", pressure, Temp); | ||
delay(100); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
******************************************************************************* | ||
* Copyright (c) 2021 by M5Stack | ||
* Equipped with M5StickCPlus sample source code | ||
* 配套 M5StickCPlus 示例源代码 | ||
* Visit for more information: https://docs.m5stack.com/en/unit/bps | ||
* 获取更多资料请访问: https://docs.m5stack.com/zh_CN/unit/bps | ||
* | ||
* Product: BPS_BMP280. 气压计 | ||
* Date: 2022/8/18 | ||
******************************************** *********************************** | ||
Please connect to Port,Read atmospheric pressure and temperature and display | ||
them on the display screen 请连接端口,读取大气压强和温度并在显示屏上显示 | ||
*/ | ||
#include <M5StickCPlus.h> | ||
#include <Adafruit_BMP280.h> | ||
|
||
Adafruit_BMP280 bme; | ||
|
||
void setup() { | ||
M5.begin(); // Init M5StickCPlus. 初始化 M5StickCPlus | ||
M5.Lcd.setRotation(3); // Rotate the screen. 旋转屏幕 | ||
Wire.begin(); // Wire init, adding the I2C bus. Wire初始化, 加入i2c总线 | ||
while (!bme.begin( | ||
0x76)) { // Init this sensor,True if the init was successful, otherwise | ||
// false. 初始化传感器,如果初始化成功返回1 | ||
M5.Lcd.println("Could not find a valid BMP280 sensor, check wiring!"); | ||
} | ||
M5.Lcd.fillScreen(BLACK); // Clear the screen. 清屏 | ||
} | ||
|
||
float pressure, | ||
Temp; // Store the vuale of pressure and Temperature. 存储压力和温度() | ||
|
||
void loop() { | ||
pressure = bme.readPressure(); | ||
Temp = bme.readTemperature(); | ||
M5.Lcd.setCursor(0, 0); //将光标设置在(0 ,0). Set the cursor to (0,0) | ||
M5.Lcd.setTextSize(2); //设置字体大小为2. Set the font size to 2 | ||
M5.Lcd.printf("Pre:%2.0fPa\nTem:%2.0f^C", pressure, Temp); | ||
delay(100); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters