Permalink
Browse files

node: fixing global buffer and removing led-id from set_led()

  • Loading branch information...
1 parent 4903ff3 commit 1dac416fc8e780acf85b0e4e749556dc0a9d0a9e @thammi thammi committed Apr 22, 2011
Showing with 5 additions and 2 deletions.
  1. +5 −2 node_lib/buzz.js
View
@@ -31,8 +31,11 @@ Buzz.prototype = new events.EventEmitter();
// - player: [0-3]
// - led: the led of the player [0-1]
// - brightness the brightness of the led [0-1]
-Buzz.prototype.set_led = function (player, led, brightness) {
- buf = new Buffer("QL$$$Q");
+Buzz.prototype.set_led = function (player, brightness) {
+ // there is only one in the hardware
+ var led = 0;
+
+ var buf = new Buffer("QL$$$Q");
buf[2] = 'A'.charCodeAt(0) + player;
buf[3] = '1'.charCodeAt(0) + led;

0 comments on commit 1dac416

Please sign in to comment.