I have tried the DS18B20 example code which since the setInterval fix (1v59) has worked faultlessly:-
var ow = new OneWire(A1);
var sensor = require("DS18B20").connect(ow);
setInterval(function() {
console.log(sensor.getTemp());
}, 1000);
However it now breaks after a couple of minutes with the following:-
ERROR: Out of Memory!
ERROR: Out of Memory!
WARNING: Out of memory while appending to array
ERROR: Out of Memory!
at line 1 col 188
{var a=[];this.bus.reset();this.bus.select(this.sCode);b&&(this.bus.write(68,!0),this.bus.reset(),this.bus.select(this.sCode));this.bus.write(190);for(b=0;9>b;b++)a.push(this.bus.read());return a}
^
in function "_readSpad" called from line 1 col 78
in function "getTemp" called from line 2 col 30
undefined
in function called from system
ERROR: Error processing interval - removing it.
Execution Interrupted during event processing.
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.
I have tried the DS18B20 example code which since the setInterval fix (1v59) has worked faultlessly:-