You are reading a single comment by @graf and its replies. Click here to read the full conversation.
  • 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.

About

Avatar for graf @graf started