Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
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); } }