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

Method measureTest

libraries/SGP30/SGP30.cpp:124–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122
123
124bool SGP30::measureTest()
125{
126 uint16_t rv = 0;
127 _command(0x2032);
128 delay(220); // Page 11
129 if (_wire->requestFrom(_address, (uint8_t)3) == 3)
130 {
131 rv = _wire->read() << 8;
132 rv += _wire->read();
133 uint8_t crc = _wire->read();
134 if (_CRC8(rv) != crc)
135 {
136 _error = SGP30_ERROR_CRC;
137 return false;
138 }
139 _error = SGP30_OK;
140 return rv == 0xD400;
141 }
142 _error = SGP30_ERROR_I2C;
143 return false;
144}
145
146
147/////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls 1

readMethod · 0.45

Tested by

no test coverage detected