You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Note: if you notice flicker, you may have to adjust the timing for your strip. Check your specification sheet. The durations are in 50ns increments. **NeoPixel** has been extended to allow custom timings.
const strand = new NeoStrand({length: 50, pin: 22, order: "RGB",
45
+
timing: Timing_WS2812B});
46
+
```
47
+
48
+
49
+
50
+
> Note: You may want to tone down your lights during development so you don't blind yourself.
51
+
>
52
+
> ```js
53
+
>strand.brightness(10);
54
+
>```
55
+
> This diminishes your color range, so use with care. The default brightness is *64* and maximum is 255.
56
+
36
57
### Schemes
37
58
38
59
A scheme is a set of effects to apply to a strand. A scheme has one or more effects applied in the specified order. Setting the new scheme takes effect immediately, even if the strand is already running.
@@ -99,11 +120,12 @@ A [list of built-in effects](#builtin) can be found later in this document.
99
120
| Parameter | default | range | description |
100
121
|---|---|---|---|
101
122
strand | (none) | | The NeoStrand to which this effect applied
102
-
start | 0 | [0..strand.length] | index of first pixel of effect
103
-
end | strand.length | [0..strand.length] | index of last pixel of effect
104
-
duration | 1000 | | (ms) duration of one cycle of the effect
105
-
reverse | 0 | [0, 1] | reverse effect
106
-
loop | 1 | [0, 1] | loop the effect
123
+
start | `0` | [0..strand.length] | The index of the first pixel of effect
124
+
end | `strand.length` | [0..strand.length] | The index of the last pixel of effect
125
+
size | `strand.length` | [0..strand.length] | The length of one hue cycle, in pixels
126
+
duration | `1000` | | The duration of one complete cycle of the effect, in ms
127
+
reverse | `0` | [0, 1] | Set to 1 to run the effect in reverse, i.e. run the timeline of the effect backwards
128
+
loop | `1` | [0, 1] | Set to 1 to loop the effect
107
129
108
130
`start` and `end` define the span of pixels that this effect will operate on. `duration` is the length of one cycle of the effect.
size | \<strand.length\> | [1..strand.length] | length of one cycle (0-2π radians) (in pixels)
217
-
reverse | 0 | [0, 1] | reverse effect
218
-
loop | 1 | [0, 1] | loop the effect
219
-
duration | 1000 | | (ms) time of one complete sine cycle
238
+
start | `0` | [0..strand.length] | The index of the first pixel of effect
239
+
end | `strand.length` | [0..strand.length] | The index of the last pixel of effect
240
+
size | `strand.length` | [0..strand.length] | The length of one hue cycle, in pixels
241
+
duration | 1000 | | time of one complete sine cycle, in ms
242
+
reverse | `0` | [0, 1] | Set to 1 to run the effect in reverse, i.e. run the timeline of the effect backwards
243
+
loop | `1` | [0, 1] | Set to 1 to loop the effect
220
244
speed | 1.0 | | speed multiplier
221
245
loop | 1 | [0, 1] | loop the effect
222
246
position | 0 | [0..1] | starting x position
@@ -233,14 +257,13 @@ The `Pulse` effect sets `size` number of pixels at a location and then moves it
233
257
| Parameter | default | range | description |
234
258
|---|---|---|---|
235
259
strand | (none) | | The NeoStrand to which this effect is applied
236
-
start | 0 | [0..strand.length] | index of first pixel of effect
237
-
end | strand.length | [0..strand.length] | index of last pixel of effect
238
-
size | 3 | [1..strand.length] | (pixels) size of a pulse
239
-
reverse | 0 | [0, 1] | reverse effect
240
-
loop | 1 | [0, 1] | loop the effect
241
-
direction | 0 | [-1, 0, 1] | direction of effect
260
+
start | `0` | [0..strand.length] | The index of the first pixel of effect
261
+
end | `strand.length` | [0..strand.length] | The index of the last pixel of effect
262
+
size | `strand.length` | [0..strand.length] | The length of one hue cycle, in pixels
263
+
duration | 3000 | | time of one pulse cycle, in ms
264
+
reverse | `0` | [0, 1] | Set to 1 to run the effect in reverse, i.e. run the timeline of the effect backwards
265
+
loop | `1` | [0, 1] | Set to 1 to loop the effect
242
266
position | "random" | [-strand.length..strand.length] | index of the pulse starting pixel<br>negative numbers are off-strand and okay<br>"random" picks a random starting location
243
-
duration | 3000 | | (ms) time of one pulse cycle
244
267
mode | 1 | [-1, 0, 1] | **1** to add, **-1** to subtract, or **0** set the pixel color
245
268
fade | 0.2 | [0..1] | how quickly tails fade
246
269
rgb | { r: 0x80, g: 0x80, b: 0x80 } | | RGB color elements
@@ -269,87 +292,8 @@ The `Dim` effect reduces the color for each pixel in the span over over the `dur
269
292
strand | (none) | | The NeoStrand to which this effect is applied
270
293
start | 0 | [0..strand.length] | index of first pixel of effect
271
294
end | strand.length | [0..strand.length] | index of last pixel of effect
272
-
duration | 1000 | | (ms) time to reduce a full-brightness pixel to off
273
-
295
+
duration | 1000 | | time to reduce a full-brightness pixel to off, in ms
274
296
275
-
<!--
276
-
<a id="ease"></a>
277
-
### Ease
278
-
279
-
The `Ease` effect uses the easing equations to move a pixel.
280
-
281
-
A `size` and `sizeB` parameters define the pattern. For example { sizeA: 1, sizeB: 3 } will produce the repeating pattern: [ A, B, B, B, A, B, B, B, A ... ]
282
-
283
-
| Parameter | default | range | description |
284
-
|---|---|---|---|
285
-
strand | (none) | | The NeoStrand to which this effect is applied
286
-
start | (none) | [0..strand.length] | index of the first pixel of effect
287
-
end | (none) | [0..strand.length] | index of the last pixel of effect
288
-
size | 3 | [1..strand.length] | (pixels) size of a pulse
289
-
reverse | 0 | [0, 1] | reverse effect
290
-
loop | 1 | [0, 1] | loop the effect
291
-
direction | 0 | [-1, 1] | direction of effect
292
-
easing | null | | easing equation to use, null uses a linear easing function
293
-
rgb | { r: 0x80, g: 0x80, b: 0x80 } | | RGB color elements
294
-
295
-
296
-
<a id="bounce"></a>
297
-
### Bounce
298
-
299
-
The `Bounce` effect bounces a small segment (ball) of pixels back and forth, erasing (setting to black) the pixel in the front and back of the ball.
300
-
301
-
| Parameter | default | description |
302
-
|---|---|---|
303
-
strand | (none) | The NeoStrand to which this effect is applied
304
-
start | (none) | index of the first pixel of effect
305
-
end | (none) | index of the last pixel of effect
306
-
size | 3 | number of pixels of the 'ball'
307
-
first | \<start\> | index of the pulse starting pixel<br>negative numbers are off-strand and okay<br>"random" picks a random starting location
308
-
direction | 1 | starting direction of travel (1 or -1)
309
-
speed | 1.0 | number of pixels traveled per iteration
310
-
r, g, b | 0xff (white) | RGB color elements
311
-
312
-
313
-
<a id="sparkle"></a>
314
-
### Sparkle
315
-
316
-
The `Sparkle` effect applies a varying color value to a small segment of pixels. The pixels lighten and darken the color while gradually fading.
317
-
318
-
| Parameter | default | description |
319
-
|---|---|---|
320
-
strand | (none) | The NeoStrand to which this effect is applied
321
-
start | (none) | index of the first pixel of effect
322
-
end | (none) | index of the last pixel of effect
323
-
size | 5 | number of pixels of the sparkle
324
-
range | 100 | [0-255] how quickly the pixels fade (random from 0-range)
325
-
decay | 15 | [0-255] how quickly the overall sparkle fades
326
-
next | 500 | time (ms) between new sparkle locations
327
-
r, g, b | 0xff (white) | RGB color elements
328
-
329
-
330
-
<a id="fire"></a>
331
-
### Fire
332
-
333
-
The `Fire` effect. Adapted from [Fire2012](https://blog.kriegsman.org/2014/04/04/fire2012-an-open-source-fire-simulation-for-arduino-and-leds/).
334
-
335
-
Fire is affected by three parameters. The first `cooling` controls how fast the flame cools down. More cooling means shorter flames. The recommended values are between 20 and 100.
336
-
337
-
The second `sparking` controls the chance (out of 255) that a spark will ignite. A higher value makes the fire more active. The recommended values are between 50 and 200.
338
-
339
-
The third `delay` controls the speed of fire activity. A higher value makes the flame flicker more slowly. The recommended values are between 0 and 20.
340
-
341
-
342
-
| Parameter | default | description |
343
-
|---|---|---|
344
-
strand | (none) | The NeoStrand to which this effect is applied
345
-
start | (none) | index of the first pixel of effect
346
-
end | (none) | index of the last pixel of effect
347
-
direction | 1 | starting direction of travel (1 or -1)
348
-
cooling | 55 | [0-255] number of pixels of the sparkle
349
-
sparking | 120 | [0-255] number of pixels of the sparkle
350
-
delay | 15 | time (ms) between actions
351
-
352
-
-->
353
297
354
298
## Making a custom effect
355
299
@@ -364,7 +308,7 @@ Let's make a random color effect. It will set `size` pixels to a random color, c
364
308
strand | (none) | | The NeoStrand to which this effect is applied
365
309
start | 0 | [0..strand.length] | index of first pixel of effect
366
310
end | strand.length | [0..strand.length] | index of last pixel of effect
367
-
duration | 1000 | | (ms) time between color changes
311
+
duration | 1000 | | length time between color changes, in ms
368
312
size | 5 | [0..strand.length] | size of each color
369
313
max | 127 | [0..255] | maximium value of random RGB component
370
314
@@ -405,5 +349,22 @@ class RandomColor extends NeoStrandEffect {
405
349
Then create and add the effect your scheme list and give it a try.
406
350
407
351
```js
408
-
schemes.push( [ newRandomColor( { strand } ) ]);
352
+
let randomColorScheme = [ newRandomColor({ strand }) ];
353
+
manySchemes.push( randomColorScheme );
409
354
```
355
+
356
+
## Timing
357
+
358
+
Timing specifications for the various driver chips of the LEDs are included for reference below.
0 commit comments