MPL115A2


Used for measuring barometric pressure.

For more information click here.

How To Connect

var Cylon = require('cylon');

Cylon.robot({
  connections: {
    arduino: { adaptor: 'firmata', port: '/dev/ttyACM0' }
  },

  devices: {
    mpl115a2: { driver: 'mpl115a2' }
  },

});

How To Use

var Cylon = require('cylon');

Cylon.robot({
  connections: {
    arduino: { adaptor: 'firmata', port: '/dev/ttyACM0' }
  },

  devices: {
    mpl115a2: { driver: 'mpl115a2' }
  },

  work: function(my) {
    every((2).seconds(), function() {
      my.mpl115a2.getTemperature(function(err, data) {
        var temp = data.temperature,
            pressure = data.pressure;

        console.log("temperature " + temp  + " pressure " + pressure);
      });
    });
  }
}).start();

Commands

getPressure

Gets value of the pressure.

Params

  • callback (Function)

Returns


getTemperature

Gets value of the temperature.

Params

  • callback (Function)

Returns

Circuit

Compatibility