diff options
author | Daniel Friesel <derf@finalrewind.org> | 2022-05-15 16:13:36 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2022-05-15 16:13:36 +0200 |
commit | c257eb1d7f455d79b8e59e0cb5081925ede83296 (patch) | |
tree | 3b3eb2e794316707fb064e6cbd8fcfbb53f0380e /src | |
parent | 9bac2f01b1f182ad8d889db905da1543129a7542 (diff) |
scd4x: properly transmit read command
Diffstat (limited to 'src')
-rw-r--r-- | src/driver/scd4x.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/driver/scd4x.cc b/src/driver/scd4x.cc index dfb6ee0..3ad34a0 100644 --- a/src/driver/scd4x.cc +++ b/src/driver/scd4x.cc @@ -37,7 +37,7 @@ void SCD4x::read() txbuf[0] = 0xec; txbuf[1] = 0x05; - if (i2c.xmit(address, 1, txbuf, 9, rxbuf) == 0) { + if (i2c.xmit(address, 2, txbuf, 9, rxbuf) == 0) { co2 = (rxbuf[0] << 8) + rxbuf[1]; rawTemperature = ((rxbuf[3] << 8) + rxbuf[4]); rawHumidity = (rxbuf[6] << 8) + rxbuf[7]; |