<commit_before>var i2c = require('i2c');
var _ = require('underscore');
var constants = require('./lib/constants.js');
var command = constants.command;
var value = constants.value;
var limit = constants.limit;

var wire = new i2c(value.DEFAULT_I2C_ADDRESS, {device: value.I2C_BUS_ID});

//var out = _.range(0x03, 0x78, 1);
//console.log(out);

wire.readBytes(command.GET_ID, limit.I2C_MAX_LEN, function(err, res) {
    if ( err ){
        console.log("Error:\n");
        console.log(err);
    }
    var b = Buffer.isBuffer(res);
    if ( b ){
        console.log('true');
        console.log(res.length);
        var j = JSON.stringify(res);
        console.log(j);
        console.log(res[1]);
        if ( res[1] == value.I2C_ID_PICOBORG_REV ){
            console.log('Found PicoBorg Reverse!');
        }
    } else {
        console.log('false');
    }
});

wire.scan(function(err, data) {
    if ( err !== null ){
        console.log(err);
    } else {
        for( var d in data ){
            if ( data[d] !== 0 ){
                var hex = data[d];
                var dec = "0x" + hex.toString(16);
                console.log("hex: " + data[d] + ", dec: " + dec);
            }
        }
    }
});<commit_msg>Test LED functions<commit_after>var pbr = require('./lib/picoborgrev.js').picoborgrev();

process.on('SIGINT', function() {
    pbr.MotorsOff(function(err){
        if ( err ){
            console.log("Error: " + err);
        }
    });    
});

/*
pbr.GetMotor2(function(err,res){
    if ( err ){
        console.log("Error: " + err);
    }
    if ( res ){
        console.log(res);
    }
});
*/

/*
pbr.SetMotors(100, function(err){
    if ( err ){
        console.log("Error: " + err);
    console.log("SetMotors");
    }
});
*/

pbr.SetLed(false, function(err){
    if ( err ){
        console.log("Error: " + err);
    }
});
{'fraction_non_alphanumeric': 0.18486486486486486, 'fraction_numerical': 0.012972972972972972, 'mean_word_length': 2.126689189189189, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6823620', 'n_tokens_mistral': 669, 'n_tokens_neox': 652, 'n_words': 116}