The 1st example is for a DS18B20 which has programmable
temperature resolutions of 0.5°C, 0.25°C, 0.125°C, or 0.0625°C.
It assumes the sensor is configured for 12 bit mode, with a resolution
of 0.0625°C per step.
The 2nd example is most likely for the DS18S20, which has 9-bit
resolution, which corresponds to 0.5°C steps.
Bookmarks