Skip to content

Commit a7c1106

Browse files
committed
PM25 & Ethernet2
1 parent f0c563e commit a7c1106

File tree

6 files changed

+586
-16
lines changed

6 files changed

+586
-16
lines changed

examples/KIT/PM25/PM25.ino

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
#include "M5_ENV.h"
55

66
SHT3X sht30;
7-
7+
float temp = 0.0;
8+
float humd = 0.0;
89
#define TFT_GREY 0x7BEF
910

1011
#define DATA_LEN 32
@@ -144,13 +145,13 @@ void LCD_Display_Val(void) {
144145
}
145146

146147
void TempHumRead(void) {
147-
float humd, temp;
148148
if (sht30.get() == 0) { // Obtain the data of shT30. 获取sht30的数据
149-
humd = sht30.cTemp; // Read Humidity
150-
temp = sht30.humidity; // Read Temperature
149+
temp = sht30.cTemp; // Store the temperature obtained from shT30.
150+
// 将sht30获取到的温度存储
151+
humd = sht30.humidity; // Store the humidity obtained from the SHT30.
152+
// 将sht30获取到的湿度存储
151153
} else {
152-
humd = 0; // Read Humidity
153-
temp = 0; // Read Temperature
154+
temp = 0, humd = 0;
154155
}
155156

156157
M5.Lcd.setTextColor(TFT_GREEN, TFT_BLACK);

0 commit comments

Comments
 (0)