Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 1dac416fc8e780acf85b0e4e749556dc0a9d0a9e 1 parent 4903ff3
thammi thammi authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 node_lib/buzz.js
7 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;
Please sign in to comment.
Something went wrong with that request. Please try again.