-
-
Notifications
You must be signed in to change notification settings - Fork 265
Examples
You can find these examples in the Arduino IDE examples menu under "NeoPixelBus by Makuna".
NOTE: The examples are constantly being improved and changed. New ones may be present with the latest releases and some less helpful older ones maybe removed.
This is a good place to start and make sure your pixels work.
This is a simple example that sets four pixels to red, green, blue, and white in order; and then flashes off and then on again. If the first pixel is green and the second is red, you need to use the NeoRgbFeature with NeoPixelBus constructor.
YouTube video of sample running
This is a good place to start and make sure your pixels work.
This is a simple example that sets four pixels to red, green, blue, and white in order; and then flashes off and then on again. If the color order is different, then you need to enter an issue listing the order you see and a solution will be provided.
This example will move a trail of light around a series of pixels with a fading tail. A ring formation of pixels looks best.
YouTube video of sample running
This example draw a trail of light and then rotate all the pixels so that it looks like a series of pixels with a fading tail. A ring formation of pixels looks best.
This example demonstrates the use of the NeoPixelBrightnessBus which exposes an inherent overall brightness control of the strip.
This example will move a Cylon Red Eye back and forth across the full collection of 16 pixels on the strip. This will demonstrate the use of the NeoVerticalSpriteSheet object and PROGMEM stored bitmaps. You may need to export the included image for your specific NeoPixel using the Arduino NeoPixel Sketch Exporter Paint.Net plugin.
This example will move a Cylon Red Eye back and forth across the full collection of pixels on the strip. This will demonstrate the use of the NeoEase animation ease methods, that provide simulated acceleration to the animations.
This will demonstrate the use of the NeoGamma object for color gamma correction.
This example will display a timed series of color gradients with gamma correction and then without.
If the last pixel is on, then the colors being shown are color corrected.
It will show Red gradient, Green gradient, Blue gradient, a White gradient, and then repeat.
This example will randomly select a number pixels and then start an animation to blend them from their current color to randomly selected a color.
YouTube video of sample running
This example will randomly pick a color and fade all pixels to that color, then it will fade them to black and restart over.
YouTube video of sample running
This is a more complex example that demonstrates platform specific animation callbacks and the timescale support for long duration animations.
YouTube video of sample running
This will animate pixels using a bitmap that is stored on a SD card. It will show one row at a time on the strip every 60ms and thus animate a single pixel high sprite. This will demonstrate the use of the NeoBitmapFile object.
This sample demonstrates the use of the NeoTopology and Layout objects to allow for x and y reference to pixels on a matrix panel. It will display specific colors in specific locations on the led panel using the defined Topology. This is useful in confirming the layout of your panel.
This sample will use the NeoTopology and Layout objects and dump a grid of index values to the serial output.
The output is displayed as row column labeled grid with the NeoPixelBus index of the pixel at the intersection of the row and column.
This is useful in visualizing the layout of your panel so can you confirm you have the correct pattern. It does not require that you have the actual panel connected.
An example of the serial output follows.
0 1 2 3 4 5 6 7
------------------------------------------------------------------
0 | 0 15 16 31 32 47 48 63
1 | 1 14 17 30 33 46 49 62
2 | 2 13 18 29 34 45 50 61
3 | 3 12 19 28 35 44 51 60
4 | 4 11 20 27 36 43 52 59
5 | 5 10 21 26 37 42 53 58
6 | 6 9 22 25 38 41 54 57
7 | 7 8 23 24 39 40 55 56
This sample demonstrates the use of the NeoTiles and Layout objects to allow for x and y reference to pixels on multiple matrix panels placed together. It will display specific colors in specific locations on the led panels using the defined Topology. This is useful in confirming the layout of your panels.
This sample will use the NeoTiles and Layout objects and dump a grid of index values to the serial output.
The output is displayed as row column labeled grid with the NeoPixelBus index of the pixel at the intersection of the row and column.
To help with physical layout, there maybe included a symbol following the index with the following meanings.
< means the index is the input index for the panel, the first on the panel
> means the index is the output index for the panel, the last on the panel
This is useful in visualizing the layout of your panels so you can confirm you have the correct pattern. It does not require that you have the actual panel connected.
An example of the serial output follows. (NOTE: Due to Wiki Paste messing with tabs, its looks bad, but it is very readable in the serial output)
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0 | 0< 15 16 31 32 47 48 63> 128< 143 144 159 160 175 176 191> 256< 271 272 287 288 303 304 319> 384< 399 400 415 416 431 432 447>
1 | 1 14 17 30 33 46 49 62 129 142 145 158 161 174 177 190 257 270 273 286 289 302 305 318 385 398 401 414 417 430 433 446
2 | 2 13 18 29 34 45 50 61 130 141 146 157 162 173 178 189 258 269 274 285 290 301 306 317 386 397 402 413 418 429 434 445
3 | 3 12 19 28 35 44 51 60 131 140 147 156 163 172 179 188 259 268 275 284 291 300 307 316 387 396 403 412 419 428 435 444
4 | 4 11 20 27 36 43 52 59 132 139 148 155 164 171 180 187 260 267 276 283 292 299 308 315 388 395 404 411 420 427 436 443
5 | 5 10 21 26 37 42 53 58 133 138 149 154 165 170 181 186 261 266 277 282 293 298 309 314 389 394 405 410 421 426 437 442
6 | 6 9 22 25 38 41 54 57 134 137 150 153 166 169 182 185 262 265 278 281 294 297 310 313 390 393 406 409 422 425 438 441
7 | 7 8 23 24 39 40 55 56 135 136 151 152 167 168 183 184 263 264 279 280 295 296 311 312 391 392 407 408 423 424 439 440
8 | 64< 79 80 95 96 111 112 127> 192< 207 208 223 224 239 240 255> 320< 335 336 351 352 367 368 383> 448< 463 464 479 480 495 496 511>
9 | 65 78 81 94 97 110 113 126 193 206 209 222 225 238 241 254 321 334 337 350 353 366 369 382 449 462 465 478 481 494 497 510
10 | 66 77 82 93 98 109 114 125 194 205 210 221 226 237 242 253 322 333 338 349 354 365 370 381 450 461 466 477 482 493 498 509
11 | 67 76 83 92 99 108 115 124 195 204 211 220 227 236 243 252 323 332 339 348 355 364 371 380 451 460 467 476 483 492 499 508
12 | 68 75 84 91 100 107 116 123 196 203 212 219 228 235 244 251 324 331 340 347 356 363 372 379 452 459 468 475 484 491 500 507
13 | 69 74 85 90 101 106 117 122 197 202 213 218 229 234 245 250 325 330 341 346 357 362 373 378 453 458 469 474 485 490 501 506
14 | 70 73 86 89 102 105 118 121 198 201 214 217 230 233 246 249 326 329 342 345 358 361 374 377 454 457 470 473 486 489 502 505
15 | 71 72 87 88 103 104 119 120 199 200 215 216 231 232 247 248 327 328 343 344 359 360 375 376 455 456 471 472 487 488 503 504
This sample demonstrates the use of the NeoMosaic and Layout objects to allow for x and y reference to pixels on multiple matrix panels placed together. It will display specific colors in specific locations on the led panels using the defined Topology. This is useful in confirming the layout of your panels.
This sample will use the NeoMosaic and Layout objects and dump a grid of index values to the serial output.
The output is displayed as row column labeled grid with the NeoPixelBus index of the pixel at the intersection of the row and column.
To help with physical layout, there maybe included a symbol following the index with the following meanings.
< means the index is the input index for the panel, the first on the panel
> means the index is the output index for the panel, the last on the panel
This is useful in visualizing the layout of your panels so you can confirm you have the correct pattern. It does not require that you have the actual panel connected.
An example of the serial output follows. If you look closely, you will see the output of one panel is very close physically to the input of the next panel. (NOTE: Due to Wiki Paste messing with tabs, its looks bad, but it is very readable in the serial output)
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0 | 0< 15 16 31 32 47 48 63> 64< 79 80 95 96 111 112 127> 128< 143 144 159 160 175 176 191> 192< 207 208 223 224 239 240 255>
1 | 1 14 17 30 33 46 49 62 65 78 81 94 97 110 113 126 129 142 145 158 161 174 177 190 193 206 209 222 225 238 241 254
2 | 2 13 18 29 34 45 50 61 66 77 82 93 98 109 114 125 130 141 146 157 162 173 178 189 194 205 210 221 226 237 242 253
3 | 3 12 19 28 35 44 51 60 67 76 83 92 99 108 115 124 131 140 147 156 163 172 179 188 195 204 211 220 227 236 243 252
4 | 4 11 20 27 36 43 52 59 68 75 84 91 100 107 116 123 132 139 148 155 164 171 180 187 196 203 212 219 228 235 244 251
5 | 5 10 21 26 37 42 53 58 69 74 85 90 101 106 117 122 133 138 149 154 165 170 181 186 197 202 213 218 229 234 245 250
6 | 6 9 22 25 38 41 54 57 70 73 86 89 102 105 118 121 134 137 150 153 166 169 182 185 198 201 214 217 230 233 246 249
7 | 7 8 23 24 39 40 55 56 71 72 87 88 103 104 119 120 135 136 151 152 167 168 183 184 199 200 215 216 231 232 247 248
8 | 504 503 488 487 472 471 456 455 440 439 424 423 408 407 392 391 376 375 360 359 344 343 328 327 312 311 296 295 280 279 264 263
9 | 505 502 489 486 473 470 457 454 441 438 425 422 409 406 393 390 377 374 361 358 345 342 329 326 313 310 297 294 281 278 265 262
10 | 506 501 490 485 474 469 458 453 442 437 426 421 410 405 394 389 378 373 362 357 346 341 330 325 314 309 298 293 282 277 266 261
11 | 507 500 491 484 475 468 459 452 443 436 427 420 411 404 395 388 379 372 363 356 347 340 331 324 315 308 299 292 283 276 267 260
12 | 508 499 492 483 476 467 460 451 444 435 428 419 412 403 396 387 380 371 364 355 348 339 332 323 316 307 300 291 284 275 268 259
13 | 509 498 493 482 477 466 461 450 445 434 429 418 413 402 397 386 381 370 365 354 349 338 333 322 317 306 301 290 285 274 269 258
14 | 510 497 494 481 478 465 462 449 446 433 430 417 414 401 398 385 382 369 366 353 350 337 334 321 318 305 302 289 286 273 270 257
15 | 511> 496 495 480 479 464 463 448< 447> 432 431 416 415 400 399 384< 383> 368 367 352 351 336 335 320< 319> 304 303 288 287 272 271 256<