I just had a similar situation with an ESP32 and 2 one wire devices using a breadboard.
A search would show the codes:
var ow = new OneWire(D23); var sensors = ow.search().map(function (device) { return require("DS18B20").connect(ow, device); });
=[ { "bus": OneWire { "pin": D23 }, "sCode": "28cc2e230500006b", "type": 28 }, { "bus": OneWire { "pin": D23 }, "sCode": "283260dc04000001", "type": 28 } ]
however - the reads failed. It turns out the pins were not seated properly - enough to get the ROM code, but not enough for a reading.
var model = { temp: [50,50] }; function readTemps() { sensors.forEach(function (sensor, index) { model.temp[index]=sensor.getTemp(); console.log(model); }); }
@Wilberforce 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 just had a similar situation with an ESP32 and 2 one wire devices using a breadboard.
A search would show the codes:
however - the reads failed. It turns out the pins were not seated properly - enough to get the ROM code, but not enough for a reading.