Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "nodeimu", | ||
"version": "1.0.2", | ||
"description": "Native addon for accessing IMU sensors using RTIMULib2", | ||
"version": "1.0.3", | ||
"description": "Native addon for accessing IMU/pressure/humidity/temperature sensors using RTIMULib2", | ||
"license": "BSD-2-Clause-FreeBSD", | ||
@@ -12,8 +12,16 @@ "author": "Jan Rupnik <jan.rupnik@ijs.si>", | ||
"main": "./index.js", | ||
"engines": { | ||
"node": "0.12.7" | ||
"dependencies": { | ||
"nan": "~2.1.0" | ||
}, | ||
"dependencies": { | ||
"nan": "^2.1.0" | ||
} | ||
"keywords": [ | ||
"raspberry", | ||
"pi", | ||
"sense", | ||
"hat", | ||
"RTIMULib", | ||
"IMU", | ||
"pressure", | ||
"humidity", | ||
"temperature" | ||
] | ||
} |
# nodeimu | ||
Nodejs 0.12 bindings for accessing IMU data using RTIMULib2. | ||
Nodejs bindings for accessing IMU/pressure/humidity/temperature data using RTIMULib2. The addon uses nodejs/nan. It has been tested on Sense HAT for Raspberry Pi. | ||
@@ -10,3 +10,3 @@ ## Install | ||
npm install node-gyp -g | ||
node-gyp configure build | ||
npm install | ||
``` | ||
@@ -13,0 +13,0 @@ |
13
test.js
@@ -5,8 +5,9 @@ var util = require('util') | ||
function dispAccel() { | ||
var accel = IMU.getValue(); | ||
var sx = accel.x >= 0 ? ' ' : ''; | ||
var sy = accel.y >= 0 ? ' ' : ''; | ||
var sz = accel.z >= 0 ? ' ' : ''; | ||
var str = util.format('%s%s %s%s %s%s', sx, accel.x.toFixed(4), sy, accel.y.toFixed(4), sz, accel.z.toFixed(4)); | ||
console.log(str); | ||
var data = IMU.getValue(); | ||
var sx = data.accelx >= 0 ? ' ' : ''; | ||
var sy = data.accely >= 0 ? ' ' : ''; | ||
var sz = data.accelz >= 0 ? ' ' : ''; | ||
var str = util.format('ax:%s%s ay:%s%s az:%s%s', sx, data.accelx.toFixed(4), sy, data.accely.toFixed(4), sz, data.accelz.toFixed(4)); | ||
var str2 = util.format(' t:%s p:%s h:%s', data.temperature.toFixed(4), data.pressure.toFixed(4), data.humidity.toFixed(4)); | ||
console.log(str + str2); | ||
} | ||
@@ -13,0 +14,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2434818
14
+ Addednan@2.1.0(transitive)
- Removednan@2.22.0(transitive)
Updatednan@~2.1.0