Skip to content
Snippets Groups Projects
Unverified Commit afe39c8b authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

ccs811: add setEnv variant with float arguments

parent 785c417f
No related branches found
No related tags found
No related merge requests found
...@@ -31,6 +31,7 @@ class CCS811 { ...@@ -31,6 +31,7 @@ class CCS811 {
void setMode(unsigned char mode); void setMode(unsigned char mode);
void read(); void read();
void setEnv(unsigned char humi, unsigned char humi_fraction, unsigned char temp, unsigned char temp_fraction); void setEnv(unsigned char humi, unsigned char humi_fraction, unsigned char temp, unsigned char temp_fraction);
void setEnv(float humi, float temp);
void reset(); void reset();
}; };
......
...@@ -65,6 +65,11 @@ void CCS811::setEnv(unsigned char humi, unsigned char humi_fraction, unsigned ch ...@@ -65,6 +65,11 @@ void CCS811::setEnv(unsigned char humi, unsigned char humi_fraction, unsigned ch
i2c.xmit(address, 5, txbuf, 0, rxbuf); 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() unsigned char CCS811::getStatus()
{ {
txbuf[0] = 0x00; txbuf[0] = 0x00;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment