 	digitalWrite(PIN_COL_LATCH, HIGH);
 
 	// Switch the row on row driver if needed
-	if (col_iter == 0) {
+	if (col_i == 0) {
 		SPI.transfer(1 << row_i);
 
 		// Latch it

	
	// Go to the next column. If reached the end of line, jump to next.
	col_i++;
	if (col_i > 7) col_i=0;
	col_iter++;
	if (col_iter > 7) {
		// Anti-ghosting measure: Start drawing the row from
		// different column every time.
		col_i++;
		if (col_i > 7) col_i=0;

		col_iter = 0;
		row_i++;
		if (row_i > 6) {
			row_i = 0;

uint8_t (*buf_front)[56] = buf_a;
uint8_t (*buf_back)[56] = buf_b;
uint8_t col_i = 0;
uint8_t row_i = 0;
volatile uint8_t may_flip = 0;
int pwm_lengths[] = { 0x30, 0x10, 0x06 }; // PWM cycle lengths
