adafruit / Adafruit_MAX31865

Arduino Library for Adafruit MAX31865 RTD Sensor
78 stars 81 forks source link

Some errors will never appear... #5

Open dl9sec opened 6 years ago

dl9sec commented 6 years ago

Hi,

as far as i see, the errors

MAX31865_FAULT_REFINLOW MAX31865_FAULT_REFINHIGH MAX31865_FAULT_RTDINLOW

will never appear. These are the bits 3 to 5 in the fault register, which are only handled, if a fault-detection cycle is initiated through the config register. Neither readFault() nor any other method seems to trigger a fault-detection cycle. Could be a great improvement to do this alway in readFault() or to overload the method and give a parameter to trigger automatic or manual fault-detection mode. Currently an unconnected sensor could not be detected through readFault(), but this is implied trough the example.

Edit: I supplied two patches for the .cpp and .h files with an extended readFault() method. Just call readFault(true) to initiate a fault-detection cycle. readFault(false) gives the same result as readFault(). To be improved... :-)

Regards, Thorsten

Adafruit_MAX31865.cpp.patch.txt Adafruit_MAX31865.h.patch.txt

xmenxwk commented 6 years ago

You should have added a pull request.