Permalink
Browse files

node: Only reporting button keystrokes and fix splitter

  • Loading branch information...
1 parent 54016fe commit ea8ecdaf8aca8df691a81d07a4382417941ad97e @thammi thammi committed Apr 22, 2011
Showing with 4 additions and 2 deletions.
  1. +4 −2 node_lib/buzz.js
View
@@ -9,15 +9,17 @@ function Buzz(device) {
databits: 8,
parity: 0,
stopbits: 1,
- parser: serialport.parsers.readline("Q"),
+ parser: serialport.parsers.readline("\r\n"),
}
var that = this;
this.port = port = new serialport.SerialPort(device, options);
port.on("data", function(data) {
- that.emit("button", data[1] - '0'.charCodeAt(0));
+ if(data[0] == "K") {
+ that.emit("button", data[1] - 'A'.charCodeAt(0));
+ }
});
}

0 comments on commit ea8ecda

Please sign in to comment.