Permalink
Browse files

fix quotes, delete dead file

  • Loading branch information...
1 parent 40f1359 commit b7dfd1ef9cd5fa62f266094ae759bcba38175c99 @rmurphey committed Sep 16, 2012
Showing with 1 addition and 69 deletions.
  1. +0 −68 lib/rgb.js
  2. +1 −1 lib/rgbled.js
View
@@ -1,68 +0,0 @@
-// Derived and adapted from
-var Board = require("../lib/board.js"),
- five = require("../lib/johnny-five.js"),
- es6 = require("es6-collections"),
- WeakMap = es6.WeakMap;
-
-// Led instance private data
-var priv = new WeakMap();
-var colors = [ 'red', 'green', 'blue' ];
-
-function RGBLed( opts ) {
- if ( !(this instanceof RGBLed) ) {
- return new RGBLed( opts );
- }
-
- opts = Board.options( opts );
-
- this.board = Board.mount( opts );
- this.firmata = this.board.firmata;
-
- colors.forEach(function(color) {
- this[ color ] = new five.Led( opts[ color ] );
- }, this);
-
- priv.set(this, {
- red: 0,
- green: 0,
- blue: 0
- });
-}
-
-RGBLed.prototype.setColor = function( color ) {
- var red, green, blue;
-
- function hexToInt( val ) {
- return parseInt( val, 16 );
- }
-
- red = hexToInt( color.slice(0, 2) );
- green = hexToInt( color.slice(2, 4) );
- blue = hexToInt( color.slice(4, 6) );
-
- priv.set( this, {
- red: red,
- green: green,
- blue: blue
- });
-
- this.red.brightness( red );
- this.green.brightness( green );
- this.blue.brightness( blue );
-};
-
-RGBLed.prototype.on = function() {
- var brightness = priv.get( this )
- colors.forEach(function( color ) {
- this[ color ].on();
- this[ color ].brightness( brightness[ color ] );
- }, this);
-};
-
-RGBLed.prototype.off = function() {
- colors.forEach(function( color ) {
- this[ color ].off();
- });
-};
-
-module.exports = RGBLed;
View
@@ -5,7 +5,7 @@ var Board = require("../lib/board.js"),
// Led instance private data
var priv = new WeakMap();
-var colors = [ 'red', 'green', 'blue' ];
+var colors = [ "red", "green", "blue" ];
function RGBLed( opts ) {
if ( !(this instanceof RGBLed) ) {

0 comments on commit b7dfd1e

Please sign in to comment.