Skip to content

Commit

Permalink
Added spark internal rgb support
Browse files Browse the repository at this point in the history
  • Loading branch information
Javier Candalaft committed Mar 29, 2015
1 parent 87529d0 commit 190296c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/spark.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,17 @@ Spark.prototype.pinMode = function(pin, mode) {
return this;
};

Spark.prototype["setInternalRGB"] = function(red, green, blue){
var state = priv.get(this);
var buffer = new Buffer(4);
buffer[0] = 0x07;
buffer[1] = red;
buffer[2] = green;
buffer[3] = blue;
state.socket.write(buffer);
return this;
};

["analogWrite", "digitalWrite", "servoWrite"].forEach(function(fn) {
var isAnalog = fn === "analogWrite";
var isServo = fn === "servoWrite";
Expand Down

0 comments on commit 190296c

Please sign in to comment.