저는 수동 적외선 탐지기와 C.H.I.P.로 작업하기 위해 Johnny-Five를 사용하고 있습니다. 리눅스, 싱글 보드 컴퓨터. 모든 것이 일반적으로 잘 작동합니다.Node.js의 Johnny-Five 이벤트에 대한 청취자를 제거하십시오.
그러나 내가이처럼 핀 버튼을 정의한 말 :
let button = new five.Button({
pin: 'XIO-P0'
});
let pir = new five.Pin({
pin: 'PWM0',
type: 'digital',
mode: 0
});
을 그리고 나는이 같은 이벤트 버튼 누름을 읽고 듣고 결정하는 어떤 점에서 :
button.on('press', function() {
console.log('Button pressed');
});
pir.read(function (error, value) {
if (error) {
console.log('Error:', error);
} else {
console.log('Pin:', value);
}
});
Johnny-Five에게 더 이상 그 이벤트를 듣고 싶지 않다고 어떻게 말합니까? 내 인생에서 문서 나 Google에서 언급 된 내용을 찾을 수 없습니다.
도움을 주시면 감사하겠습니다.