summaryrefslogtreecommitdiff
path: root/src/driver
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-12-19 22:24:25 +0100
committerDaniel Friesel <derf@finalrewind.org>2021-12-19 22:24:25 +0100
commitafe39c8baefc92f0d8f9c719990299f6affa498d (patch)
tree3a9f8201b0143791881ac5eed60470ad24fd5b41 /src/driver
parent785c417f499326a64b290d79badcbe59eee60fd7 (diff)
ccs811: add setEnv variant with float arguments
Diffstat (limited to 'src/driver')
-rw-r--r--src/driver/ccs811.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/driver/ccs811.cc b/src/driver/ccs811.cc
index 66c238a..531dadb 100644
--- a/src/driver/ccs811.cc
+++ b/src/driver/ccs811.cc
@@ -65,6 +65,11 @@ void CCS811::setEnv(unsigned char humi, unsigned char humi_fraction, unsigned ch
i2c.xmit(address, 5, txbuf, 0, rxbuf);
}
+void CCS811::setEnv(float humi, float temp)
+{
+ setEnv(humi * 2, 0, (temp - 25) * 2, 0);
+}
+
unsigned char CCS811::getStatus()
{
txbuf[0] = 0x00;