Interesting project. I love WS2812 LEDs.
The code you use to encode the pattern to program the WS2812 could be simplified a lot if you simply used a bit mask variable instead of doing a hardcoded binary test of every combination.
Instead, do something like:
unsigned char m;
for(....)
...
m = 0b10000000;
do {
if ((temp & m) == m) {
// code for outputting 1 to WS2812
} else {
// code for outputting 0 to WS2812
}
// shift the bitmask to the right
// after shifting 8 times, m will be 0
m >>= 1;
} while (m > 0);
....
}
This will result in much small code and it will also be a lot more efficient since you only need to test the mask once (in your code, you test it 8 times for each loop).
Hope this helps.