ok I'm confused about the bit shifting. So I traced 9 iterations of the loop and I don't see whats happening.
// load current plane pattern data into ports
ledpin = 0;
for (ledrow=0; ledrow<CUBESIZE; ledrow++) {
for (ledcol=0; ledcol<CUBESIZE; ledcol++) {
digitalWrite( LEDPin[ledpin++], PatternBuf[patbufidx] & (1 << ledcol) );
}
}
Here's where I'm confused.
B0011 & (1<<0) => B011 & 1
B0011 & (1<<1) => B011 & 10
B0011 & (1<<2) => B011 &100
How do I know when the pin is in the high/low state? I'm assuming B000 & 1 would be in the low state. I guess I don't understand the AND operator.