/*
* 人体感应 HC-SR501
* */
var _sensor = require('./sensor');
var _comm = require('./comm');

//检测是否有人
exports.interaction = function(callback) {
    _comm.readValue(_sensor.body.pin, function (r) {
        if (callback && typeof callback == 'function') {
            if (r && r == "1") {
                callback(true);
            }
            else {
                callback(false);
            }
        }
    });
}