Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    xloborgpublic

    XLoBorg

    node.js version of XLoBorg python library

    Disclaimer

    This is in no way an official XLoBorg library

    Usage

    var xloborg = require('xloborg');
    
    // prepare for use
    xloborg.init(function(err){
        if (err){
         console.error(err);
        }
        else {
            console.log('ready');
        }
    });
    
    // read accelometer
    xloborg.readAccelometer(function(err, result){
        if (err){
            console.error(err);
        }
        else {
            var accelerometer = {
                x: result[0],
                y: result[1],
                z: result[2]
            }
        }
    });
    
    // read compass
    xloborg.readCompass(function(err, result){
        if (err){
          console.error(err);
        }
        else {
             var compass = {
                x: result[0],
                y: result[1],
                z: result[2]
        }
    }
    });
    
    // read temperature
    xloborg.readTemperature(function(err, result){
        if (err){
            console.error(err);
        }
        else {
         var temperature = result;
        }
    });
    

    Test

    node xloborg/test.js

    should result in something similar to:

    {
        accelerometer: [0.078125, 0.00625, 1.734735],
        compass: [-381, -354, 1068],
        temperature: 25
    }
    //...more objects
    

    install

    npm i xloborg

    Downloadsweekly downloads

    5

    version

    1.0.1

    license

    ISC

    repository

    githubgithub

    last publish

    collaborators

    • avatar