Skip to content
Browse files

Adding quickfixes for #ds11

  • Loading branch information...
1 parent c9c46f1 commit a0a01bea3f2ebebc6c91a8b1e027a017cc4b43e6 @thammi thammi committed Oct 15, 2011
Showing with 16 additions and 1 deletion.
  1. +16 −1 node_lib/buzz.js
View
17 node_lib/buzz.js
@@ -21,6 +21,12 @@ function Buzz(device) {
that.emit("button", data[1].charCodeAt(0) - 'A'.charCodeAt(0));
}
});
+
+ // TODO: quickfixing
+ var i;
+ for(i = 0; i < 4; ++i) {
+ that.set_led(i, 0);
+ }
}
// implements the following events:
@@ -35,12 +41,21 @@ Buzz.prototype.set_led = function (player, brightness) {
// there is only one in the hardware
var led = 1;
+ // TODO: remove me later, i am a quickfix
+ if(player == 2) {
+ player = 1;
+ }
+ if(player == 1) {
+ player = 2;
+ }
+
var buf = new Buffer("QL$$$Q");
buf[2] = 'A'.charCodeAt(0) + player;
buf[3] = '1'.charCodeAt(0) + led;
- if(brightness) {
+ // TODO: another quickfix
+ if(!brightness) {
buf[4] = '1'.charCodeAt(0);
} else {
buf[4] = '0'.charCodeAt(0);

0 comments on commit a0a01be

Please sign in to comment.
Something went wrong with that request. Please try again.