<commit_before>/*********************************************
Demonstrates axes by turning on a different
LED per axis (x, y, z) only when that axis
has positive acceleration. Also prints +/-
per axis to the console.
*********************************************/

var tessel = require('tessel');
var accel = require('accel-mma84').use(tessel.port('A'));

// define vars
var led1 = tessel.led[1].output();
var led2 = tessel.led[2].output();
var led3 = tessel.led[3].output();

var textOut = "";

accel.on('ready', function(){
  accel.on('data', function(xyz){
    // refresh variables;
    var x = xyz[0];
    var y = xyz[1];
    var z = xyz[2];

    textOut = "";

    // light & print which axes are positive
    if(x > 0) {
      led1.high();
      textOut += "x: + | ";
    } else {
      led1.low();
      textOut += "x: - | ";
    }
    if(y > 0) {
      led2.high();
      textOut += "y: + | ";
    } else {
      led2.low();
      textOut += "y: - | ";
    }
    if(z > 0) {
      led3.high();
      textOut += "z: +";
    } else {
      led3.low();
      textOut += "z: -";
    }

    console.log(textOut);
  });<commit_msg>updated new example to stylistic convention<commit_after>/*********************************************
Demonstrates axes by turning on a different
LED per axis (x, y, z) only when that axis
has positive acceleration. Also prints +/-
per axis to the console.
*********************************************/

var tessel = require('tessel');
var accel = require('accel-mma84').use(tessel.port('A'));

// Define vars
var led1 = tessel.led[1].output();
var led2 = tessel.led[2].output();
var led3 = tessel.led[3].output();

var textOut = "";

accel.on('ready', function(){
  accel.on('data', function(xyz){
    // Refresh variables;
    var x = xyz[0];
    var y = xyz[1];
    var z = xyz[2];

    textOut = "";

    // light & print which axes are positive
    if(x > 0) {
      led1.high();
      textOut += "x: + | ";
    } else {
      led1.low();
      textOut += "x: - | ";
    }
    if(y > 0) {
      led2.high();
      textOut += "y: + | ";
    } else {
      led2.low();
      textOut += "y: - | ";
    }
    if(z > 0) {
      led3.high();
      textOut += "z: +";
    } else {
      led3.low();
      textOut += "z: -";
    }

    console.log(textOut);
  });
{'fraction_non_alphanumeric': 0.2534843205574913, 'fraction_numerical': 0.017421602787456445, 'mean_word_length': 2.448948948948949, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '4293726', 'n_tokens_mistral': 833, 'n_tokens_neox': 781, 'n_words': 199}