How to use the johnny-five.Accelerometer function in johnny-five

To help you get started, we’ve selected a few johnny-five examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Azure / connectthedots / Devices / DirectlyConnectedDevices / NodeJS / IntelEdisonXadow / inteledisonctd.js View on Github external
controller: "BMP180"
    });
    
    multi.on("change", function() {
        // console.log("BMP180");
        // console.log("  pressure     : ", this.barometer.pressure);
        // console.log("  temperature  : ", this.temperature.celsius)
        // console.log("--------------------------------------");
        temp = this.temperature.celsius;
        // var currentTime = new Date().toISOString();
        // send_message(format_sensor_data(settings.guid1, settings.displayname, settings.organization, settings.location, "Temperature", "C", currentTime , this.temperature.celsius), currentTime);
    
    });
    
    // Initialize accelerometer    
    var accelerometer = new five.Accelerometer({
        controller: "ADXL345"
    });
    
    accelerometer.on("change", function() {
        // console.log("accelerometer");
        // console.log("  x            : ", this.x);
        // console.log("  y            : ", this.y);
        // console.log("  z            : ", this.z);
        // console.log("  pitch        : ", this.pitch);
        // console.log("  roll         : ", this.roll);
        // console.log("  acceleration : ", this.acceleration);
        // console.log("  inclination  : ", this.inclination);
        // console.log("  orientation  : ", this.orientation);
        // console.log("--------------------------------------");
        acc += this.acceleration;
        nbaccmeasures++ ;
github w4ilun / edison-guides / recipies / Johnny-Five Examples / accelerometer.js View on Github external
board.on("ready", function() {
  var accelerometer = new five.Accelerometer({
    controller: "ADXL335",
    pins: ["A0", "A1", "A2"]
  });
  
  accelerometer.on("change", function() {
    console.log("accelerometer");
    console.log("  x            : ", this.x);
    console.log("  y            : ", this.y);
    console.log("  z            : ", this.z);
    console.log("  pitch        : ", this.pitch);
    console.log("  roll         : ", this.roll);
    console.log("  acceleration : ", this.acceleration);
    console.log("  inclination  : ", this.inclination);
    console.log("  orientation  : ", this.orientation);
    console.log("--------------------------------------");
  });
github fivdi / pi-io / example / i2c-accelerometer.js View on Github external
board.on('ready', function() {
  const accelerometer = new five.Accelerometer({
    controller: 'ADXL345'
  });

  accelerometer.on('change', function() {
    console.log('accelerometer');
    console.log('  x            : ', this.x);
    console.log('  y            : ', this.y);
    console.log('  z            : ', this.z);
    console.log('  pitch        : ', this.pitch);
    console.log('  roll         : ', this.roll);
    console.log('  acceleration : ', this.acceleration);
    console.log('  inclination  : ', this.inclination);
    console.log('  orientation  : ', this.orientation);
    console.log('--------------------------------------');
  });
});
github fivdi / linux-io / example / raspberry-pi / i2c-accelerometer.js View on Github external
board.on('ready', function() {
  const accelerometer = new five.Accelerometer({
    controller: 'ADXL345'
  });

  accelerometer.on('change', function() {
    console.log('accelerometer');
    console.log('  x            : ', this.x);
    console.log('  y            : ', this.y);
    console.log('  z            : ', this.z);
    console.log('  pitch        : ', this.pitch);
    console.log('  roll         : ', this.roll);
    console.log('  acceleration : ', this.acceleration);
    console.log('  inclination  : ', this.inclination);
    console.log('  orientation  : ', this.orientation);
    console.log('--------------------------------------');
  });
});
github fivdi / linux-io / example / beaglebone-black / i2c-accelerometer.js View on Github external
board.on('ready', function() {
  const accelerometer = new five.Accelerometer({
    controller: 'ADXL345'
  });

  accelerometer.on('change', function() {
    console.log('accelerometer');
    console.log('  x            : ', this.x);
    console.log('  y            : ', this.y);
    console.log('  z            : ', this.z);
    console.log('  pitch        : ', this.pitch);
    console.log('  roll         : ', this.roll);
    console.log('  acceleration : ', this.acceleration);
    console.log('  inclination  : ', this.inclination);
    console.log('  orientation  : ', this.orientation);
    console.log('--------------------------------------');
  });
});
github fivdi / linux-io / example / chip / i2c-accelerometer.js View on Github external
board.on('ready', function() {
  const accelerometer = new five.Accelerometer({
    controller: 'ADXL345'
  });

  accelerometer.on('change', function() {
    console.log('accelerometer');
    console.log('  x            : ', this.x);
    console.log('  y            : ', this.y);
    console.log('  z            : ', this.z);
    console.log('  pitch        : ', this.pitch);
    console.log('  roll         : ', this.roll);
    console.log('  acceleration : ', this.acceleration);
    console.log('  inclination  : ', this.inclination);
    console.log('  orientation  : ', this.orientation);
    console.log('--------------------------------------');
  });
});

johnny-five

The JavaScript Robotics and Hardware Programming Framework. Use with: Arduino (all models), Electric Imp, Beagle Bone, Intel Galileo & Edison, Linino One, Pinoccio, pcDuino3, Raspberry Pi, Particle/Spark Core & Photon, Tessel 2, TI Launchpad and more!

MIT
Latest version published 3 years ago

Package Health Score

56 / 100
Full package analysis