树莓派2吧 关注:58贴子:86
  • 0回复贴,共1

跪求大神,关于信号输出的问题刚接触树莓派需要完成毕业设计。

只看楼主收藏回复

是tsl2591 传感器,测得是可见光和红外线。我只想得到红外线的数据。输出格式为(红外线数据,时间)。请问下面程序我应该修改哪一部分?
/*
* Read raw data from the TSL2591 once per second and show on console output.
*/
var tsl2591 = require('tsl2591');
/* Use /dev/i2c-0 on older Raspis */
var light = new tsl2591({device: '/dev/i2c-1'});
if (light === null) {
console.log("TSL2591 not found");
process.exit(-1);
}
light.init({AGAIN: 1, ATIME: 1 }, function(err) {
if (err) {
console.log(err);
process.exit(-2);
}
});
showLum();
function showLum() {
light.readLuminosity(function(err, data) {
if (err) {
console.log(err);
}
else {
console.log(data);
}
});
setTimeout(showLum, 100);
}


IP属地:美国1楼2016-11-19 04:49回复