Skip to content

Commit

Permalink
Merge pull request #49 from canda/master
Browse files Browse the repository at this point in the history
Added spark internal rgb support
  • Loading branch information
rwaldron committed Apr 1, 2015
2 parents 87529d0 + 190296c commit 0b4acce
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 0b4acce

Please sign in to comment.