

var systemCtrl = require("systemCtrl.js");


var cilckFlag = 0;
function disCilck() {
    system("echo 0 > /sys/devices/platform/soc@3000000/2502800.twi/i2c-2/2-0014/vib")
    cilckFlag = 1;
}
function onCilck() {
    system("echo 1 > /sys/devices/platform/soc@3000000/2502800.twi/i2c-2/2-0014/vib")
    
}
function checklongPressCilck() {
    console.log("------checklongPressCilck----");
    if (cilckFlag == 0) { 
         onCilck();
    }
    else if (cilckFlag == 1) {
        cilckFlag = 0;
    }
}
function system(com) {
    systemCtrl.executeSystemCommand(com)
}

module.exports = {
    disCilck: disCilck,
    onCilck: onCilck,
    checklongPressCilck: checklongPressCilck,

}