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

Method readBytes

libraries/tinySHT2x/tinySHT2x.cpp:89–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87
88
89bool tinySHT2x::readBytes(uint8_t n, uint8_t *val, uint8_t maxDuration)
90{
91 _wire->requestFrom((uint8_t)SHT2x_ADDRESS, (uint8_t) n);
92 uint32_t start = millis();
93 while (_wire->available() < n)
94 {
95 if (millis() - start > maxDuration)
96 {
97 return false;
98 }
99 yield();
100 }
101
102 for (uint8_t i = 0; i < n; i++)
103 {
104 val[i] = _wire->read();
105 }
106 return true;
107}
108
109
110// -- END OF FILE --

Callers

nothing calls this directly

Calls 2

availableMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected