@Wilberforce I think it's best not to worry about the initial value - people have been using this DS18B20 module for years and are happy to just put up with it.
Producing a good first value half the time is worse than never doing it :)
Should getTemp return the last value, even with a callback, rather than undefined?
I don't think so... It's another request over OneWire and more calculation that will never be used most of the time...
The callback needs some sort of identifier, as you can't assume the order of the readings in the callbacks.
I don't think so - you can easily re-write your code:
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.
@Wilberforce I think it's best not to worry about the initial value - people have been using this DS18B20 module for years and are happy to just put up with it.
Producing a good first value half the time is worse than never doing it :)
I don't think so... It's another request over OneWire and more calculation that will never be used most of the time...
I don't think so - you can easily re-write your code:
And there are plenty of other ways to do this that don't require changes in the module.