Arduino-Temperature-Control-Library icon indicating copy to clipboard operation
Arduino-Temperature-Control-Library copied to clipboard

bitResolution may be wrong upon a recallScratchPad()

Open QRPp opened this issue 4 years ago • 0 comments

Hello,

please consider such a scenario (~pseudocode).

Setup:

setWaitForConversion(true);
setCheckForConversion(false);

Trigger:

setAutoSaveScratchPad(true);
setResolution(12);
setAutoSaveScratchPad(false);
setResolution(9);
recallScratchPad();

Problem: requestTemperatures() will not wait long enough now (bitResolution should be 12 but is 9).

There is more than one way to correct that, a straightforward one is to reevaluate bitResolution upon a recallScratchPad().

I hope this helps!

QRPp avatar Mar 31 '21 00:03 QRPp