value 0 -> alarm off
value 1 -> alarm on
-----------------------------------------
Temp for Sensor A: 26.25 -> 1
Temp for Sensor A: 26.31 -> 1
Temp for Sensor A: 25.56 -> 1
Temp for Sensor A: 24.56 -> 0
Temp for Sensor A: 23.75 -> 0
Temp for Sensor A: 23.00 -> 0
Temp for Sensor A: 22.31 -> 0
Temp for Sensor A: 21.75 -> 0
Temp for Sensor A: 21.31 -> 0
Temp for Sensor A: 20.81 -> 1
Temp for Sensor A: 20.44 -> 1
Temp for Sensor A: 20.06 -> 1
Temp for Sensor A: 19.75 -> 1
Temp for Sensor A: 19.44 -> 1
I set the temperature range between 20° and 25°. So we have the same issue. I guess it's a bug or feature of the sensor :-) It seems that the alarm recognize only floor values.
If the measured temperature is lower than or equal to TL or higher
than or equal to TH, an alarm condition exists and an alarm flag is
set inside the DS18B20
Hmmm, but what would be the right way now? Somehow, I am not happy with a subtraction of the minimal value, but that would be a simple and quick solution.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
@Gordon: so now i have a comparison.
This is the output from the SparkCore which also use the DallasTemperature library (https://github.com/tomdeboer/SparkCoreDallasTemperature).
I set the temperature range between 20° and 25°. So we have the same issue. I guess it's a bug or feature of the sensor :-) It seems that the alarm recognize only floor values.
Additionally i read the specification and found the definition:
(http://datasheets.maximintegrated.com/en/ds/DS18B20.pdf -> page 4 at the last paragraph)
Hmmm, but what would be the right way now? Somehow, I am not happy with a subtraction of the minimal value, but that would be a simple and quick solution.
What do you think?