Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nodeimu

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodeimu - npm Package Compare versions

Comparing version 1.0.3 to 2.0.0

sav

2

package.json
{
"name": "nodeimu",
"version": "1.0.3",
"version": "2.0.0",
"description": "Native addon for accessing IMU/pressure/humidity/temperature sensors using RTIMULib2",

@@ -5,0 +5,0 @@ "license": "BSD-2-Clause-FreeBSD",

var util = require('util')
var nodeimu = require('./index.js');
var IMU = new nodeimu.IMU();
function dispAccel() {
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));
var num = 0;
console.time("async");
var callb = function (e, data) {
if (e) {
console.log(e);
return;
}
var sx = data.accel.x >= 0 ? ' ' : '';
var sy = data.accel.y >= 0 ? ' ' : '';
var sz = data.accel.z >= 0 ? ' ' : '';
var str = util.format('%s%s %s%s %s%s', sx, data.accel.x.toFixed(4), sy, data.accel.y.toFixed(4), sz, data.accel.z.toFixed(4));
var str2 = util.format(' %s %s %s', data.temperature.toFixed(4), data.pressure.toFixed(4), data.humidity.toFixed(4));
console.log(str + str2);
num++;
if (num == 100) {
console.timeEnd("async");
} else {
setTimeout(function() { IMU.getValue(callb); } , 50);
}
}
setInterval(dispAccel, 50);
IMU.getValue(callb);

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc