This seems to have fixed the fault reporting issue.
exports.connect = function(spi,cs) { return new MAX31855(spi,cs); }; function MAX31855(spi,cs) { this.spi=spi; this.cs=cs; } MAX31855.prototype.getTemp = function () { var d = this.spi.send("\0\0\0\0",this.cs); var trtn={}; trtn.temp=(d.charCodeAt(0)<<6 | d.charCodeAt(1)>>2)*0.25; if (d.charCodeAt(1) & 1) { var fault = (d.charCodeAt(3) & 7); switch (fault) { case 1: return trtn.fault="No probe detected"; case 3: return trtn.fault="Probe shorted to Ground"; case 4: return trtn.fault="Probe shorted to VCC"; default: return trtn.fault=fault; } } else{ return trtn; }};
@user7143 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.
This seems to have fixed the fault reporting issue.