1 Star 0 Fork 0

Sunny / node-hid

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
test-powermate.js 560 Bytes
一键复制 编辑 原始数据 按行查看 历史
Tod E. Kurt 提交于 2016-11-16 15:24 . fix whitespace
var PowerMate = require('./powermate');
var powerMate;
for (var i = 0; i < PowerMate.deviceCount(); i++) {
console.log('opening powermate', i);
powerMate = new PowerMate.PowerMate(i);
powerMate.on('buttonDown', function () {
console.log('button down');
this.position = 0;
});
powerMate.on('buttonUp', function () {
console.log('button up');
});
powerMate.on('turn', function (delta, position) {
console.log('delta', delta, 'position', position);
this.setLed(position % 256);
});
}
1
https://gitee.com/ztes/node-hid.git
git@gitee.com:ztes/node-hid.git
ztes
node-hid
node-hid
master

搜索帮助