Nucleo-transfer
Dependencies: BurstSPI
Dependents: Nucleo-transfer Nucleo-transfer Nucleo-transfer
Fork of PixelArray by
Revision 4:c3b314df3dfe, committed 2014-08-20
- Comitter:
- mcapewel
- Date:
- Wed Aug 20 19:57:54 2014 +0000
- Parent:
- 3:6f392fcb1d3b
- Child:
- 5:47802e75974e
- Commit message:
- Fix order of bits for 400kHz protocol.
Changed in this revision
neopixel.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- 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); } }