Skip to content

Commit dcc3475

Browse files
committed
update sht30 example
1 parent dbcc65e commit dcc3475

7 files changed

Lines changed: 13 additions & 9 deletions

File tree

examples/Hat_ENVIII_M5StickC/Hat_ENVIII_M5StickC.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include <M5StickC.h>
1717
#include "M5_ENV.h"
1818

19-
SHT3X sht30(0x44, 1);
19+
SHT3X sht30;
2020
QMP6988 qmp6988;
2121

2222
float tmp = 0.0;
@@ -29,6 +29,7 @@ void setup() {
2929
Wire.begin(0, 26);
3030

3131
qmp6988.init();
32+
sht30.init();
3233
M5.lcd.println(F("ENVIII Hat(SHT30 and QMP6988) test"));
3334
}
3435

examples/Hat_ENVIII_M5StickCPlus/Hat_ENVIII_M5StickCPlus.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include <M5StickCPlus.h>
1717
#include "M5_ENV.h"
1818

19-
SHT3X sht30(0x44, 1);
19+
SHT3X sht30;
2020
QMP6988 qmp6988;
2121

2222
float tmp = 0.0;
@@ -29,6 +29,7 @@ void setup() {
2929
Wire.begin(0, 26);
3030

3131
qmp6988.init();
32+
sht30.init();
3233
M5.lcd.println(F("ENVIII Hat(SHT30 and QMP6988) test"));
3334
}
3435

examples/Hat_ENVII_M5StickC/Hat_ENVII_M5StickC.ino

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <Adafruit_BMP280.h>
2323
#include "Adafruit_Sensor.h"
2424

25-
SHT3X sht30(0x44, 1);
25+
SHT3X sht30;
2626
Adafruit_BMP280 bme;
2727

2828
float tmp = 0.0;
@@ -33,11 +33,12 @@ void setup() {
3333
M5.begin(); // Init M5StickC. 初始化 M5StickC
3434
M5.Lcd.setRotation(3); // Rotate the screen. 旋转屏幕
3535
Wire.begin(0, 26);
36+
sht30.init();
3637
M5.Lcd.println(F("ENVII Unit(SHT30 and BMP280) test...\n"));
3738
}
3839

3940
void loop() {
40-
while (!bme.begin(0x76)) { //初始化bme传感器. Init the sensor of bme
41+
while (!bme.begin(0x76)) { // 初始化bme传感器. Init the sensor of bme
4142
M5.Lcd.println("Could not find a valid BMP280 sensor, check wiring!");
4243
}
4344
pressure = bme.readPressure(); // Stores the pressure gained by BMP.

examples/Hat_ENVII_M5StickCPlus/Hat_ENVII_M5StickCPlus.ino

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <Adafruit_BMP280.h>
2323
#include "Adafruit_Sensor.h"
2424

25-
SHT3X sht30(0x44, 1);
25+
SHT3X sht30;
2626
Adafruit_BMP280 bme;
2727

2828
float tmp = 0.0;
@@ -33,11 +33,12 @@ void setup() {
3333
M5.begin(); // Init M5StickCPlus. 初始化 M5StickCPlus
3434
M5.Lcd.setRotation(3); // Rotate the screen. 旋转屏幕
3535
Wire.begin(0, 26);
36+
sht30.init();
3637
M5.Lcd.println(F("ENVII Unit(SHT30 and BMP280) test...\n"));
3738
}
3839

3940
void loop() {
40-
while (!bme.begin(0x76)) { //初始化bme传感器. Init the sensor of bme
41+
while (!bme.begin(0x76)) { // 初始化bme传感器. Init the sensor of bme
4142
M5.Lcd.println("Could not find a valid BMP280 sensor, check wiring!");
4243
}
4344
pressure = bme.readPressure(); // Stores the pressure gained by BMP.

examples/Unit_ENVIV_M5Core/Unit_ENVIV_M5Core.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void loop() {
9191
Serial.println(humidity);
9292
}
9393
pressure = bmp.readPressure();
94-
M5.Lcd.setCursor(0, 0); //将光标设置在(0 ,0). Set the cursor to (0,0)
94+
M5.Lcd.setCursor(0, 0); // 将光标设置在(0 ,0). Set the cursor to (0,0)
9595
M5.Lcd.printf("Pressure:%2.0fPa\nTemperature:%2.0f^C", pressure,
9696
temperature);
9797
M5.Lcd.setCursor(0, 40);

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"type": "git",
1111
"url": "https://github.com/m5stack/M5Unit-ENV.git"
1212
},
13-
"version": "0.0.8",
13+
"version": "0.0.9",
1414
"frameworks": "arduino",
1515
"platforms": "espressif32"
1616
}

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=M5Unit-ENV
2-
version=0.0.8
2+
version=0.0.9
33
author=M5Stack
44
maintainer=M5Stack
55
sentence=Library for M5Stack UNIT ENV

0 commit comments

Comments
 (0)