<commit_before>var GrovePi = require('node-grovepi').GrovePi;
var Commands = GrovePi.commands;
var Board = GrovePi.board;
var DHTDigitalSensor = GrovePi.sensors.DHTDigital;

var board;

function start() {
    console.log('starting...');
    board = new Board({
        debug: true,
        onError: function(err) {
            console.log('Oops! Something error.');
            console.log(err);
        },
        onInit: function(res) {
            if(res) {
                console.log('GrovePi Version : ' + board.version());
                
                // Connect the Grove Temperature&Humidity Sensor to digital port D8                
                var dhtSensor = new DHTDigitalSensor(8, DHTDigitalSensor.VERSION.DHT22, DHTDigitalSensor.CELSIUS);
                // DHT Sensor
                console.log('DHT Digital Sensor (start watch)');
                dhtSensor.on('change', function(res) {
                    console.log('DHT onChange value=' + res)
                });
                dhtSensor.watch(500); // milliseconds

            }
        }
    });
    board.init();
}

function onExit(err) {
    console.log('ending');
    board.close();
    process.removeAllListeners();
    process.exit();
    if (typeof err != 'undefined')
        console.log(err);
}


//start the app
start();

// catches ctrl+c event
process.on('SIGINT', onExit);<commit_msg>change sensor version to DHT11<commit_after>var GrovePi = require('node-grovepi').GrovePi;
var Commands = GrovePi.commands;
var Board = GrovePi.board;
var DHTDigitalSensor = GrovePi.sensors.DHTDigital;

var board;

function start() {
    console.log('starting...');
    board = new Board({
        debug: true,
        onError: function(err) {
            console.log('Oops! Something error.');
            console.log(err);
        },
        onInit: function(res) {
            if(res) {
                console.log('GrovePi Version : ' + board.version());
                
                // Connect the Grove Temperature&Humidity Sensor to digital port D8                
                var dhtSensor = new DHTDigitalSensor(8, DHTDigitalSensor.VERSION.DHT11, DHTDigitalSensor.CELSIUS);
                // DHT Sensor
                console.log('DHT Digital Sensor (start watch)');
                dhtSensor.on('change', function(res) {
                    console.log('DHT onChange value=' + res)
                });
                dhtSensor.watch(500); // milliseconds

            }
        }
    });
    board.init();
}

function onExit(err) {
    console.log('ending');
    board.close();
    process.removeAllListeners();
    process.exit();
    if (typeof err != 'undefined')
        console.log(err);
}


//start the app
start();

// catches ctrl+c event
process.on('SIGINT', onExit);
{'fraction_non_alphanumeric': 0.12819589485055816, 'fraction_numerical': 0.005761613251710479, 'mean_word_length': 1.9334741288278776, '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': '341605', 'n_tokens_mistral': 842, 'n_tokens_neox': 794, 'n_words': 173}