Pixel Array through SPI
Diff: neopixel.cpp
- Revision:
- 4:c3b314df3dfe
- Parent:
- 3:6f392fcb1d3b
--- a/neopixel.cpp Mon Aug 18 21:38:40 2014 +0000 +++ b/neopixel.cpp Wed Aug 20 19:57:54 2014 +0000 @@ -67,7 +67,7 @@ { int zero = 0x300; // Encode zero as 0b1100000000 int one = 0x3e0; // Encode one as 0b1111100000 - for (int i = 1; i < 256; i *= 2) { + for (int i = 128; i >= 1; i >>= 1) { spi.fastWrite((bits & i) ? one : zero); } }