#Accelerometer
Driver for the accel-mma84 Tessel accelerometer module (MMA8452Q).
##Installation
npm install accel-mma84
##Example
var tessel = require('tessel');
console.log("Connecting to accelerometer on port bank A");
var accel = require('accel-mma84').use(tessel.port("A"));
accel.on('ready', function () {
accel.on('data', function (xyz) {
console.log("x:", xyz[0].toFixed(2),
"y:", xyz[1].toFixed(2),
"z:", xyz[2].toFixed(2));
});
});
accel.on('error', function(err) {
console.log("Unable to connect to module: ", err);
})
##Methods
-
accel
.getAcceleration(callback(err, xyz))
-
accel
.setOutputRate(rateInHz, callback(err, xyz))
-
accel
.availableOutputRates()
-
accel
.setScaleRange(scaleRange, callback(err, xyz))
-
accel
.availableScaleRanges()
##Events
##Further Examples
License
MIT