MCPcopy Create free account
hub / github.com/RobTillaart/Arduino / getTVOCBaseline

Method getTVOCBaseline

libraries/SGP30/SGP30.cpp:339–357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

337
338
339bool SGP30::getTVOCBaseline(uint16_t *TVOC)
340{
341 _command(0x20B3);
342 if (_wire->requestFrom(_address, (uint8_t)3) != 3)
343 {
344 _error = SGP30_ERROR_I2C;
345 return false;
346 }
347 *TVOC = _wire->read() << 8;
348 *TVOC += _wire->read();
349 uint8_t crc = _wire->read();
350 if (_CRC8(*TVOC) != crc)
351 {
352 _error = SGP30_ERROR_CRC;
353 return false;
354 }
355 _error = SGP30_OK;
356 return true;
357}
358
359
360/////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls 1

readMethod · 0.45

Tested by

no test coverage detected