need help with a specific line of code.

Hi,
I'm making an Led cube, and rather than just copy some code, i want to understand it and write a program for myself, i understand all the code except for one line, care to help?

the code is here:

the specific line is this : "digitalWrite( LEDPin[ledpin++], PatternBuf[patbufidx] & (1 << ledcol) );"

now i know this code works cuz i have loaded it up and tried it before.

so my questions:

  1. why is it LEDPin[ledpin++]? wouldnt that skip a port?
  2. In "PatternBuf[patbudfidx] & (1 << ledcol) );" patternBuf[patbudfidx] selects the byte from the array that corresponds with the row that is in question (i think), then uses an and operator (read the page on it) with the integar value of ledcol shifted to the left 1. I thought bitshifts applied to binary? and why does it do this? (my guess is that it selects the column that it should be out of the byte representing the row) if i am correct, how does this work?
  3. can you use a byte to set the state? wouldnt it return 1 or 0? can u replace HIGH and LOW with 1 and 0? i havent seen eveidence of this being true anywhere else.

Thanks for the help!

Man, that is some fancy array lookup code!

I can answer some:

HIGH = 1 = TRUE = (value that is not zero)
LOW = 0 = FALSE
Check the Reference page for correct usage of caps.

Smallest stored value is a byte, so yes on that.

"digitalWrite( LEDPin[ledpin++], PatternBuf[patbufidx] & (1 << ledcol) );"

Break it down.
"1 << ledcol" selects a single bit.
AND that bit with the byte provided by the lookup table "PatternBuf", to give a zero or non-zero (the single bit selected) result.
Now, "digitalWrite" either writes a zero or a one to the pin selected by "LEDPin [ledpin++]"

I don't understand you comment about skipping a port.