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
Diff: neopixel.cpp
- Revision:
- 7:e8b3e643085f
- Parent:
- 6:1d8c73d4c7e6
- Child:
- 8:df8daeaa3d87
--- a/neopixel.cpp Tue Mar 10 04:40:06 2015 +0000 +++ b/neopixel.cpp Tue Mar 10 04:46:49 2015 +0000 @@ -107,6 +107,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; @@ -119,7 +120,7 @@ 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++) { send_pixel(buffer[i]);