I don't even have my board yet, but when it arrives I plan to extend the DS18B20 module.
Now I'm looking at the source code at http://www.espruino.com/modules/DS18B20.js and I'm wondering if when I create multiple thermometers:
var sensor1 = require("DS18B20").connect(A1);
var sensor2 = require("DS18B20").connect(A2);
var sensor3 = require("DS18B20").connect(A13);
Is it somehow wasting memory because each object have it's own copy of getTemp() method? Or is that not the case and that's the way to do it.
@graf started
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 don't even have my board yet, but when it arrives I plan to extend the DS18B20 module.
Now I'm looking at the source code at http://www.espruino.com/modules/DS18B20.js and I'm wondering if when I create multiple thermometers:
Is it somehow wasting memory because each object have it's own copy of getTemp() method? Or is that not the case and that's the way to do it.