Skip to content

Commit 6febdd7

Browse files
committed
Fix fault in SDS011 data packet decoding
1 parent ce90bae commit 6febdd7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/hackair.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ void hackAIR::refresh(hackAirData &data) {
106106
data.error = 0;
107107

108108
// Set data
109-
data.pm25 = ((_buff[3] << 8) + _buff[2]);
110-
data.pm10 = ((_buff[5] << 8) + _buff[4]);
109+
data.pm25 = ((_buff[3] << 8) + _buff[2]) / 10.0f;
110+
data.pm10 = ((_buff[5] << 8) + _buff[4]) / 10.0f;
111111

112112
return;
113113
} else {

0 commit comments

Comments
 (0)