Modified library of Pixel Array showing main.cpp code implementing buffer/array of pixels method of updating pixel chain.
Dependents: NeoPixel-DemoBuffer Final_project Final_project
Fork of PixelArray by
Revision 8:df8daeaa3d87, committed 2015-03-10
- Comitter:
- ben_ceron
- Date:
- Tue Mar 10 06:21:35 2015 +0000
- Parent:
- 7:e8b3e643085f
- Commit message:
- Update PixelArray using buffer method.
Changed in this revision
neopixel.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r e8b3e643085f -r df8daeaa3d87 neopixel.cpp --- a/neopixel.cpp Tue Mar 10 04:46:49 2015 +0000 +++ b/neopixel.cpp Tue Mar 10 06:21:35 2015 +0000 @@ -108,18 +108,7 @@ void PixelArray::update(Pixel buffer[], uint32_t length) { // Manually set the color fields of the four pixels in the pixel buffer. - buffer[0].red = 255; - buffer[0].green = 0; - buffer[0].blue = 0; - buffer[1].red = 255; - buffer[1].green = 140; - buffer[1].blue = 0; - buffer[2].red = 0; - buffer[2].green = 255; - buffer[2].blue = 0; - buffer[3].red = 0; - buffer[3].green = 0; - buffer[3].blue = 255; + // Loop through and send each pixel to the NeoPixel. for (size_t i = 0; i < length; i++) {