Comparing version 0.1.0 to 0.1.1
@@ -44,2 +44,3 @@ var hw = process.binding('hw'); // Comment this and promisifyAnimation out to run tests | ||
this.animate(animation.framelength, animation.buffer); | ||
return this; | ||
}; | ||
@@ -50,2 +51,3 @@ | ||
this.queue.push( promisifyAnimation(animation,delay) ); | ||
return this; | ||
}; | ||
@@ -52,0 +54,0 @@ |
{ | ||
"name": "npx", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Neopixel API for Tessel", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -48,3 +48,3 @@ #Npx: A friendlier abstraction for the [Tessel Neopixel Libarary](https://github.com/tessel/neopixels) | ||
npx.play() | ||
npx.play(yourFirstAnimation); | ||
``` | ||
@@ -72,6 +72,6 @@ | ||
Immediately play animation. | ||
Immediately plays animation. | ||
``` | ||
npx.play(animation) // Immediately plays animation. | ||
npx.play(animation) | ||
``` | ||
@@ -95,5 +95,14 @@ | ||
```JavaScript | ||
var animationRed = npx.newAnimation(1) | ||
var animationBlue = npx.newAnimation(1) | ||
var animationRed = npx.newAnimation(1).setAll('#FF0000'); | ||
var animationWhite = npx.newAnimation(1).setAll('#FFFFFF'); | ||
var animationBlue = npx.newAnimation(1).setAll('#0000FF'); | ||
npx.enqueue(animationRed,1000) | ||
.enqueue(animationWhite,1000) | ||
.enqueue(animationBlue,1000) | ||
.run(); | ||
``` | ||
note how the neopixels stay blue. This is because neopixels hold their state until they loose power. If you want to turn them off, send a new blank animation to the strip. | ||
##Animation objects | ||
@@ -100,0 +109,0 @@ Colors for animations can be of the form [R,G,B] where R,G, and B are values between 0 and 255 (or hex 0x00, 0xFF). |
131
18106
351