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

Method readADC

libraries/MS5611/MS5611.cpp:265–282  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

263
264
265uint32_t MS5611::readADC()
266{
267 command(MS5611_CMD_READ_ADC);
268 if (_result == 0)
269 {
270 uint8_t length = 3;
271 int bytes = _wire->requestFrom(_address, length);
272 if (bytes >= length)
273 {
274 uint32_t value = _wire->read() * 65536UL;
275 value += _wire->read() * 256UL;
276 value += _wire->read();
277 return value;
278 }
279 return 0UL;
280 }
281 return 0UL;
282}
283
284
285int MS5611::command(const uint8_t command)

Callers

nothing calls this directly

Calls 1

readMethod · 0.45

Tested by

no test coverage detected