UNPKG

chip-io

Version:

Johnny-Five IO Plugin for the Next Thing Co. C.H.I.P.

16 lines (15 loc) 387 B
module.exports = { initialize: { value: function(options, dataHandler) { options.pin = 'INTTEMP'; // `this` refers to the Thermometer instance object this.io.pinMode(options.pin, this.io.MODES.ANALOG); this.io.analogRead(options.pin, dataHandler.bind(this)); } }, toCelsius: { value: function(raw) { return raw * 0.1 - 144.7; } } };