Here's the relevant library function - Wire.begin() has already been called - it was hanging on the commented-out //wait so I substituted the return -999 code instead, and that's what it returns: -999.
unsigned int SHT21Class::readData(byte command)
{
unsigned int result;
Wire.beginTransmission(0x40); //begin
Wire.write(command); //send the pointer location
delay(100);
Wire.endTransmission(); //end
if (Wire.requestFrom(0x40, 3) != 3) { // Request three bytes
return -999;
}
// Wire.requestFrom(0x40, 3);
// while(Wire.available() < 3)
// {
// //wait
// }
//Store the result
result = ((Wire.read()) << 8);
result += Wire.read();
result &= ~0x0003; // clear two low bits (status bits)
return result;
}