ClosedCube_SHT31D_Arduino
ClosedCube_SHT31D_Arduino copied to clipboard
Failure to return error in periodicFetchData function
Hi, I believe there is a return statement in periodicFetchData. The existing code is:
SHT31D ClosedCube_SHT31D::periodicFetchData()
{
SHT31D_ErrorCode error = writeCommand(SHT3XD_CMD_FETCH_DATA);
if (error == SHT3XD_NO_ERROR)
return readTemperatureAndHumidity();
else
returnError(error);
}
I was trying to use this function however it would not return an error if error != 0. I managed to fix the issue by changing the else statement to
return returnError(error)
As returnError only returns a value to periodicFetchData, and does not get passed anywhere else in the program.
Thanks