Duda con codigo, cubo de leds

Tengo una duda, he visto el codigo y no ecuentro en que momento pasa de binario a decir que leds enciende, quiero saber en que momento traduce los leds que deben encenderse. Me gustaria si alguien puede explicarmelo, muchas gracias. Y tambien saber para que sirve el "PROGMEM" exactamente.

#include <avr/pgmspace.h> // allows use of PROGMEM to store patterns in flash

#define CUBESIZE 4
#define PLANESIZE CUBESIZE*CUBESIZE
#define PLANETIME 2000 // time each plane is displayed in us -> 100 Hz refresh
#define TIMECONST 7.5// multiplies DisplayTime to get ms - why not =100?


const char PROGMEM PatternTable[] = {

B1111,B1111,B1111,B1111   ,B1111,B1111,B1111,B1111   ,B1111,B1111,B1111,B1111   ,B1111,B1111,B1111,B1111   , 50,
B0000,B0000,B0000,B0000   ,B0000,B0000,B0000,B0000   ,B0000,B0000,B0000,B0000   ,B0000,B0000,B0000,B0000   , 50,
B1111,B1111,B1111,B1111   ,B1111,B1111,B1111,B1111   ,B1111,B1111,B1111,B1111   ,B1111,B1111,B1111,B1111   , 45,
B0000,B0000,B0000,B0000   ,B0000,B0000,B0000,B0000   ,B0000,B0000,B0000,B0000   ,B0000,B0000,B0000,B0000   , 45,
B1111,B1111,B1111,B1111   ,B1111,B1111,B1111,B1111   ,B1111,B1111,B1111,B1111   ,B1111,B1111,B1111,B1111   , 40,
};
int LEDPin[] = {13,12,11,10,9,8,7,6,5,4,3,2,0,1,A5,A4};
int PlanePin[] = {A3, A2, A1, A0};

// initialization
void setup()
{
int pin; // loop counter
// set up LED pins as output (active HIGH)
for (pin=0; pin<PLANESIZE; pin++) {
pinMode( LEDPin[pin], OUTPUT );
}
// set up plane pins as outputs (active LOW)
for (pin=0; pin<CUBESIZE; pin++) {
pinMode( PlanePin[pin], OUTPUT );
}
}

// display pattern in table until DisplayTime is zero (then repeat)
void loop()
{
// declare variables
byte PatternBuf[PLANESIZE]; // saves current pattern from PatternTable
int PatternIdx;
byte DisplayTime; // time*100ms to display pattern
unsigned long EndTime;
int plane; // loop counter for cube refresh
int patbufidx; // indexes which byte from pattern buffer
int ledrow; // counts LEDs in refresh loop
int ledcol; // counts LEDs in refresh loop
int ledpin; // counts LEDs in refresh loop

// Initialize PatternIdx to beginning of pattern table
PatternIdx = 0;
// loop over entries in pattern table - while DisplayTime>0
do {
// read pattern from PROGMEM and save in array
memcpy_P( PatternBuf, PatternTable+PatternIdx, PLANESIZE );
PatternIdx += PLANESIZE;
// read DisplayTime from PROGMEM and increment index
DisplayTime = pgm_read_byte_near( PatternTable + PatternIdx++ );
// compute EndTime from current time (ms) and DisplayTime
EndTime = millis() + ((unsigned long) DisplayTime) * TIMECONST;

// loop while DisplayTime>0 and current time < EndTime
while ( millis() < EndTime ) {
patbufidx = 0; // reset index counter to beginning of buffer
// loop over planes
for (plane=0; plane<CUBESIZE; plane++) {
// turn previous plane off
if (plane==0) {
digitalWrite( PlanePin[CUBESIZE-1], LOW );
} else {
digitalWrite( PlanePin[plane-1], LOW );
}

// 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) );
}
patbufidx++;
}

// turn current plane on
digitalWrite( PlanePin[plane], HIGH );
// delay PLANETIME us
delayMicroseconds( PLANETIME );
} // for plane
} // while <EndTime
} while (DisplayTime > 0); // read patterns until time=0 which signals end
}