nodes/core/hardware/37-mcp3008.js
function read(mode,callback) {
      if (spi === undefined) {return;};
      var txBuf = new Buffer([1,mode,0]);
      var rxBuf = new Buffer([0,0,0]);
      
      spi.transfer(txBuf,rxBuf,function(dev,buffer) {
        var value = ((buffer[1] & 3)<< 8) + buffer[2];
        callback(value);
      });
    }
function read(mode,callback) {
      if (spi === undefined) {return;};
      var txBuf = new Buffer([1,mode,0]);
      var rxBuf = new Buffer([0,0,0]);
      
      spi.transfer(txBuf,rxBuf,function(dev,buffer) {
        var value = ((buffer[1] & 3)<< 8) + buffer[2];
        callback(value);
      });
    }
function read ( mode , callback ) { if ( spi === undefined ) { return ; } ; var txBuf = new Buffer ( [ 1 , mode , 0 ] ) ; var rxBuf = new Buffer ( [ 0 , 0 , 0 ] ) ; spi . transfer ( txBuf , rxBuf , function ( dev , buffer ) { var value = ( ( buffer [ 1 ] & 3 ) << 8 ) + buffer [ 2 ] ; callback ( value ) ; } ) ; }
lit l'interface spi
lit l interface spi