Woow...I supposed it was same sort of error message.
Going deep further the following code for DS1820 works like a charm ;)
Thank you Gordon!
readTemp = function(){
var ow = new OneWire(C10);
ow.device = ow.search()[0];
ow.reset();
ow.select(ow.device);
ow.write(0x44, true);
ow.reset();
ow.select(ow.device);
ow.write(0xBE);
var a = 3-1;
var temp_l = ow.read();
var temp_h = ow.read();
var th = ow.read();
var tl = ow.read();
var res1 = ow.read();
var res2 = ow.read();
var count_remain = ow.read();
var count_per_c = ow.read();
var temp_read = ((temp_l + (temp_h<<8))-1)/2;
var t = temp_read - 0.25 + (count_per_c - count_remain)/count_per_c;
return t;
};
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.
Woow...I supposed it was same sort of error message.
Going deep further the following code for DS1820 works like a charm ;)
Thank you Gordon!