Glowing Bounce

The solution for removing flicker is to reduce the cycle time / increase the cycle frequency. Once the frequency gets high enough the perceived flicker will be gone. The required frequency for achieving this effect depends on the maximum angular velocity of the object relative to line of vision. There are theoretical treatments on how high this may be. I will not look into these computations. Instead I will push the frequency as high as possible.

The question on how to do this boils down to determine the desired port states as fast as possible and push the results into the ports. The fastest possible computation is usually to precompute the values into an array and then just iterate on the array contents. Unfortunately the Arduino has very tight RAM constraints. So if the patterns are long but not too long we could store them in ROM. This leaves the question how to precompute values into ROM.
You may have noticed by now that we solved this already before. We can approach it as in Experiment 2 „Persistence of Vision“. That is we use a Python script that generates the desired sketch.

#!/usr/bin/python
#
#	www.blinkenlight.net
#
#	Copyright 2011 Udo Klein
#
#	This program is free software: you can redistribute it and/or modify
#	it under the terms of the GNU General Public License as published by
#	the Free Software Foundation, either version 3 of the License, or
#	(at your option) any later version.
#
#	This program is distributed in the hope that it will be useful,
#	but WITHOUT ANY WARRANTY; without even the implied warranty of
#	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#	GNU General Public License for more details.
#
#	You should have received a copy of the GNU General Public License
#	along with this program. If not, see http://www.gnu.org/licenses/


import math

# output common start of program
print """#include <MsTimer2.h>
#include <avr/io.h>
#include <avr/pgmspace.h>

const uint8_t ports = 3;
const uint8_t brightness_levels = 32;
const uint8_t period = 39;

uint8_t pov_pattern[ports*brightness_levels*period] PROGMEM = {"""

def cursor(phase): return phase if phase<period/2 else period-phase
def distance_to_cursor(LED, phase): return abs(LED-cursor(phase))
def brightness_by_distance(distance): return [32, 8, 1, 0, 0][distance] if distance<5 else 0
def brightness(LED, phase): return brightness_by_distance(distance_to_cursor(LED, phase))
def LEDstate(LED, phase, cycle): return 1 if cycle < brightness(LED, phase) else 0

period = 39
cycles = 32
LEDs = 20

# for each colum in the picture output 3 bytes
# that will be copied into the LED output ports
for phase in range(0, period):
	for cycle in range(0, cycles):
		line = "	0b"
		for LED in range(0, LEDs):
			if LED==6 or LED==12:
				line = line+", 0b"
			line = line + str(LEDstate(LED, phase, cycle))

	#   add a comment that makes it easier to see
	#   the intended meaning of the 3 bytes
		line = line + (", // phase {0:>2}, cycle {1:>2}".format(phase, cycle))

		print line

print """};
"""

##uint32_t duration(uint8_t pos) {
#return (sqrt(((float) 20-pos)/20)-sqrt(((float) 19-pos)/20))*500;

line = "uint16_t ms_delay[period] = {"
for phase in range(0, period):
	cursor = phase if 2*phase < period else period-phase
	delay = int(60*(math.sqrt(cursor+2)-math.sqrt(cursor+1)))
	line += "{0:>3},".format(delay)

print line+"};"
print """
volatile uint16_t base_index = 0;

void iterate() {
	static uint8_t index = 0;
	static uint16_t counter = 0;

	if (counter < ms_delay[index]) {
		++counter;
	} else {
		counter = 0;

		base_index = index*(ports*brightness_levels);
		++index;
		if (index == period) {
			index = 0;
		}
	}
}

void setup() {
	DDRD = 0b11111111; // set digital  0- 7 to output
	DDRB = 0b00111111; // set digital  8-13 to output
	DDRC = 0b00111111; // set digital 14-19 to output (coincidences with analog 0-5)

	MsTimer2::set(2, iterate);
	MsTimer2::start();
}

void loop() {
	static uint16_t index;
	cli();
	index = base_index;
	sei();

	for (uint8_t cycle=0; cycle<brightness_levels; ++cycle) {
		PORTC = pgm_read_byte(pov_pattern+(index++));
		PORTB = pgm_read_byte(pov_pattern+(index++));
		PORTD = pgm_read_byte(pov_pattern+(index++));
	}
}
"""

This generates a sketch similar to the POV sketch.

#include <MsTimer2.h>
#include <avr/io.h>
#include <avr/pgmspace.h>

const uint8_t ports = 3;
const uint8_t brightness_levels = 32;
const uint8_t period = 39;

uint8_t pov_pattern[ports*brightness_levels*period] PROGMEM = {
	0b111000, 0b000000, 0b00000000, // phase  0, cycle  0
	0b110000, 0b000000, 0b00000000, // phase  0, cycle  1
	0b110000, 0b000000, 0b00000000, // phase  0, cycle  2
	0b110000, 0b000000, 0b00000000, // phase  0, cycle  3
	0b110000, 0b000000, 0b00000000, // phase  0, cycle  4
	0b110000, 0b000000, 0b00000000, // phase  0, cycle  5
	0b110000, 0b000000, 0b00000000, // phase  0, cycle  6
	0b110000, 0b000000, 0b00000000, // phase  0, cycle  7
	0b100000, 0b000000, 0b00000000, // phase  0, cycle  8
	0b100000, 0b000000, 0b00000000, // phase  0, cycle  9
	0b100000, 0b000000, 0b00000000, // phase  0, cycle 10
	0b100000, 0b000000, 0b00000000, // phase  0, cycle 11
	0b100000, 0b000000, 0b00000000, // phase  0, cycle 12
	0b100000, 0b000000, 0b00000000, // phase  0, cycle 13
	0b100000, 0b000000, 0b00000000, // phase  0, cycle 14
	0b100000, 0b000000, 0b00000000, // phase  0, cycle 15
	0b100000, 0b000000, 0b00000000, // phase  0, cycle 16
	0b100000, 0b000000, 0b00000000, // phase  0, cycle 17
	0b100000, 0b000000, 0b00000000, // phase  0, cycle 18
	0b100000, 0b000000, 0b00000000, // phase  0, cycle 19
	0b100000, 0b000000, 0b00000000, // phase  0, cycle 20
	0b100000, 0b000000, 0b00000000, // phase  0, cycle 21
	0b100000, 0b000000, 0b00000000, // phase  0, cycle 22
	0b100000, 0b000000, 0b00000000, // phase  0, cycle 23
	0b100000, 0b000000, 0b00000000, // phase  0, cycle 24
	0b100000, 0b000000, 0b00000000, // phase  0, cycle 25
	0b100000, 0b000000, 0b00000000, // phase  0, cycle 26
	0b100000, 0b000000, 0b00000000, // phase  0, cycle 27
	0b100000, 0b000000, 0b00000000, // phase  0, cycle 28
	0b100000, 0b000000, 0b00000000, // phase  0, cycle 29
	0b100000, 0b000000, 0b00000000, // phase  0, cycle 30
	0b100000, 0b000000, 0b00000000, // phase  0, cycle 31
	0b111100, 0b000000, 0b00000000, // phase  1, cycle  0
	0b111000, 0b000000, 0b00000000, // phase  1, cycle  1
	0b111000, 0b000000, 0b00000000, // phase  1, cycle  2
	0b111000, 0b000000, 0b00000000, // phase  1, cycle  3
	0b111000, 0b000000, 0b00000000, // phase  1, cycle  4
	0b111000, 0b000000, 0b00000000, // phase  1, cycle  5
	0b111000, 0b000000, 0b00000000, // phase  1, cycle  6
	0b111000, 0b000000, 0b00000000, // phase  1, cycle  7
	0b010000, 0b000000, 0b00000000, // phase  1, cycle  8
	0b010000, 0b000000, 0b00000000, // phase  1, cycle  9
	0b010000, 0b000000, 0b00000000, // phase  1, cycle 10
	0b010000, 0b000000, 0b00000000, // phase  1, cycle 11
	0b010000, 0b000000, 0b00000000, // phase  1, cycle 12
	0b010000, 0b000000, 0b00000000, // phase  1, cycle 13
	0b010000, 0b000000, 0b00000000, // phase  1, cycle 14
	0b010000, 0b000000, 0b00000000, // phase  1, cycle 15
	0b010000, 0b000000, 0b00000000, // phase  1, cycle 16
	0b010000, 0b000000, 0b00000000, // phase  1, cycle 17
	0b010000, 0b000000, 0b00000000, // phase  1, cycle 18
	0b010000, 0b000000, 0b00000000, // phase  1, cycle 19
	0b010000, 0b000000, 0b00000000, // phase  1, cycle 20
	0b010000, 0b000000, 0b00000000, // phase  1, cycle 21
	0b010000, 0b000000, 0b00000000, // phase  1, cycle 22
	0b010000, 0b000000, 0b00000000, // phase  1, cycle 23
	0b010000, 0b000000, 0b00000000, // phase  1, cycle 24
	0b010000, 0b000000, 0b00000000, // phase  1, cycle 25
	0b010000, 0b000000, 0b00000000, // phase  1, cycle 26
	0b010000, 0b000000, 0b00000000, // phase  1, cycle 27
	0b010000, 0b000000, 0b00000000, // phase  1, cycle 28
	0b010000, 0b000000, 0b00000000, // phase  1, cycle 29
	0b010000, 0b000000, 0b00000000, // phase  1, cycle 30
	0b010000, 0b000000, 0b00000000, // phase  1, cycle 31
	0b111110, 0b000000, 0b00000000, // phase  2, cycle  0
	0b011100, 0b000000, 0b00000000, // phase  2, cycle  1
	0b011100, 0b000000, 0b00000000, // phase  2, cycle  2
	0b011100, 0b000000, 0b00000000, // phase  2, cycle  3
	0b011100, 0b000000, 0b00000000, // phase  2, cycle  4
	0b011100, 0b000000, 0b00000000, // phase  2, cycle  5
	0b011100, 0b000000, 0b00000000, // phase  2, cycle  6
	0b011100, 0b000000, 0b00000000, // phase  2, cycle  7
	0b001000, 0b000000, 0b00000000, // phase  2, cycle  8
	0b001000, 0b000000, 0b00000000, // phase  2, cycle  9
	0b001000, 0b000000, 0b00000000, // phase  2, cycle 10
	0b001000, 0b000000, 0b00000000, // phase  2, cycle 11
	0b001000, 0b000000, 0b00000000, // phase  2, cycle 12
	0b001000, 0b000000, 0b00000000, // phase  2, cycle 13
	0b001000, 0b000000, 0b00000000, // phase  2, cycle 14
	0b001000, 0b000000, 0b00000000, // phase  2, cycle 15
	0b001000, 0b000000, 0b00000000, // phase  2, cycle 16
	0b001000, 0b000000, 0b00000000, // phase  2, cycle 17
	0b001000, 0b000000, 0b00000000, // phase  2, cycle 18
	0b001000, 0b000000, 0b00000000, // phase  2, cycle 19
	0b001000, 0b000000, 0b00000000, // phase  2, cycle 20
	0b001000, 0b000000, 0b00000000, // phase  2, cycle 21
	0b001000, 0b000000, 0b00000000, // phase  2, cycle 22
	0b001000, 0b000000, 0b00000000, // phase  2, cycle 23
	0b001000, 0b000000, 0b00000000, // phase  2, cycle 24
	0b001000, 0b000000, 0b00000000, // phase  2, cycle 25
	0b001000, 0b000000, 0b00000000, // phase  2, cycle 26
	0b001000, 0b000000, 0b00000000, // phase  2, cycle 27
	0b001000, 0b000000, 0b00000000, // phase  2, cycle 28
	0b001000, 0b000000, 0b00000000, // phase  2, cycle 29
	0b001000, 0b000000, 0b00000000, // phase  2, cycle 30
	0b001000, 0b000000, 0b00000000, // phase  2, cycle 31
	0b011111, 0b000000, 0b00000000, // phase  3, cycle  0
	0b001110, 0b000000, 0b00000000, // phase  3, cycle  1
	0b001110, 0b000000, 0b00000000, // phase  3, cycle  2
	0b001110, 0b000000, 0b00000000, // phase  3, cycle  3
	0b001110, 0b000000, 0b00000000, // phase  3, cycle  4
	0b001110, 0b000000, 0b00000000, // phase  3, cycle  5
	0b001110, 0b000000, 0b00000000, // phase  3, cycle  6
	0b001110, 0b000000, 0b00000000, // phase  3, cycle  7
	0b000100, 0b000000, 0b00000000, // phase  3, cycle  8
	0b000100, 0b000000, 0b00000000, // phase  3, cycle  9
	0b000100, 0b000000, 0b00000000, // phase  3, cycle 10
	0b000100, 0b000000, 0b00000000, // phase  3, cycle 11
	0b000100, 0b000000, 0b00000000, // phase  3, cycle 12
	0b000100, 0b000000, 0b00000000, // phase  3, cycle 13
	0b000100, 0b000000, 0b00000000, // phase  3, cycle 14
	0b000100, 0b000000, 0b00000000, // phase  3, cycle 15
	0b000100, 0b000000, 0b00000000, // phase  3, cycle 16
	0b000100, 0b000000, 0b00000000, // phase  3, cycle 17
	0b000100, 0b000000, 0b00000000, // phase  3, cycle 18
	0b000100, 0b000000, 0b00000000, // phase  3, cycle 19
	0b000100, 0b000000, 0b00000000, // phase  3, cycle 20
	0b000100, 0b000000, 0b00000000, // phase  3, cycle 21
	0b000100, 0b000000, 0b00000000, // phase  3, cycle 22
	0b000100, 0b000000, 0b00000000, // phase  3, cycle 23
	0b000100, 0b000000, 0b00000000, // phase  3, cycle 24
	0b000100, 0b000000, 0b00000000, // phase  3, cycle 25
	0b000100, 0b000000, 0b00000000, // phase  3, cycle 26
	0b000100, 0b000000, 0b00000000, // phase  3, cycle 27
	0b000100, 0b000000, 0b00000000, // phase  3, cycle 28
	0b000100, 0b000000, 0b00000000, // phase  3, cycle 29
	0b000100, 0b000000, 0b00000000, // phase  3, cycle 30
	0b000100, 0b000000, 0b00000000, // phase  3, cycle 31
	0b001111, 0b100000, 0b00000000, // phase  4, cycle  0
	0b000111, 0b000000, 0b00000000, // phase  4, cycle  1
	0b000111, 0b000000, 0b00000000, // phase  4, cycle  2
	0b000111, 0b000000, 0b00000000, // phase  4, cycle  3
	0b000111, 0b000000, 0b00000000, // phase  4, cycle  4
	0b000111, 0b000000, 0b00000000, // phase  4, cycle  5
	0b000111, 0b000000, 0b00000000, // phase  4, cycle  6
	0b000111, 0b000000, 0b00000000, // phase  4, cycle  7
	0b000010, 0b000000, 0b00000000, // phase  4, cycle  8
	0b000010, 0b000000, 0b00000000, // phase  4, cycle  9
	0b000010, 0b000000, 0b00000000, // phase  4, cycle 10
	0b000010, 0b000000, 0b00000000, // phase  4, cycle 11
	0b000010, 0b000000, 0b00000000, // phase  4, cycle 12
	0b000010, 0b000000, 0b00000000, // phase  4, cycle 13
	0b000010, 0b000000, 0b00000000, // phase  4, cycle 14
	0b000010, 0b000000, 0b00000000, // phase  4, cycle 15
	0b000010, 0b000000, 0b00000000, // phase  4, cycle 16
	0b000010, 0b000000, 0b00000000, // phase  4, cycle 17
	0b000010, 0b000000, 0b00000000, // phase  4, cycle 18
	0b000010, 0b000000, 0b00000000, // phase  4, cycle 19
	0b000010, 0b000000, 0b00000000, // phase  4, cycle 20
	0b000010, 0b000000, 0b00000000, // phase  4, cycle 21
	0b000010, 0b000000, 0b00000000, // phase  4, cycle 22
	0b000010, 0b000000, 0b00000000, // phase  4, cycle 23
	0b000010, 0b000000, 0b00000000, // phase  4, cycle 24
	0b000010, 0b000000, 0b00000000, // phase  4, cycle 25
	0b000010, 0b000000, 0b00000000, // phase  4, cycle 26
	0b000010, 0b000000, 0b00000000, // phase  4, cycle 27
	0b000010, 0b000000, 0b00000000, // phase  4, cycle 28
	0b000010, 0b000000, 0b00000000, // phase  4, cycle 29
	0b000010, 0b000000, 0b00000000, // phase  4, cycle 30
	0b000010, 0b000000, 0b00000000, // phase  4, cycle 31
	0b000111, 0b110000, 0b00000000, // phase  5, cycle  0
	0b000011, 0b100000, 0b00000000, // phase  5, cycle  1
	0b000011, 0b100000, 0b00000000, // phase  5, cycle  2
	0b000011, 0b100000, 0b00000000, // phase  5, cycle  3
	0b000011, 0b100000, 0b00000000, // phase  5, cycle  4
	0b000011, 0b100000, 0b00000000, // phase  5, cycle  5
	0b000011, 0b100000, 0b00000000, // phase  5, cycle  6
	0b000011, 0b100000, 0b00000000, // phase  5, cycle  7
	0b000001, 0b000000, 0b00000000, // phase  5, cycle  8
	0b000001, 0b000000, 0b00000000, // phase  5, cycle  9
	0b000001, 0b000000, 0b00000000, // phase  5, cycle 10
	0b000001, 0b000000, 0b00000000, // phase  5, cycle 11
	0b000001, 0b000000, 0b00000000, // phase  5, cycle 12
	0b000001, 0b000000, 0b00000000, // phase  5, cycle 13
	0b000001, 0b000000, 0b00000000, // phase  5, cycle 14
	0b000001, 0b000000, 0b00000000, // phase  5, cycle 15
	0b000001, 0b000000, 0b00000000, // phase  5, cycle 16
	0b000001, 0b000000, 0b00000000, // phase  5, cycle 17
	0b000001, 0b000000, 0b00000000, // phase  5, cycle 18
	0b000001, 0b000000, 0b00000000, // phase  5, cycle 19
	0b000001, 0b000000, 0b00000000, // phase  5, cycle 20
	0b000001, 0b000000, 0b00000000, // phase  5, cycle 21
	0b000001, 0b000000, 0b00000000, // phase  5, cycle 22
	0b000001, 0b000000, 0b00000000, // phase  5, cycle 23
	0b000001, 0b000000, 0b00000000, // phase  5, cycle 24
	0b000001, 0b000000, 0b00000000, // phase  5, cycle 25
	0b000001, 0b000000, 0b00000000, // phase  5, cycle 26
	0b000001, 0b000000, 0b00000000, // phase  5, cycle 27
	0b000001, 0b000000, 0b00000000, // phase  5, cycle 28
	0b000001, 0b000000, 0b00000000, // phase  5, cycle 29
	0b000001, 0b000000, 0b00000000, // phase  5, cycle 30
	0b000001, 0b000000, 0b00000000, // phase  5, cycle 31
	0b000011, 0b111000, 0b00000000, // phase  6, cycle  0
	0b000001, 0b110000, 0b00000000, // phase  6, cycle  1
	0b000001, 0b110000, 0b00000000, // phase  6, cycle  2
	0b000001, 0b110000, 0b00000000, // phase  6, cycle  3
	0b000001, 0b110000, 0b00000000, // phase  6, cycle  4
	0b000001, 0b110000, 0b00000000, // phase  6, cycle  5
	0b000001, 0b110000, 0b00000000, // phase  6, cycle  6
	0b000001, 0b110000, 0b00000000, // phase  6, cycle  7
	0b000000, 0b100000, 0b00000000, // phase  6, cycle  8
	0b000000, 0b100000, 0b00000000, // phase  6, cycle  9
	0b000000, 0b100000, 0b00000000, // phase  6, cycle 10
	0b000000, 0b100000, 0b00000000, // phase  6, cycle 11
	0b000000, 0b100000, 0b00000000, // phase  6, cycle 12
	0b000000, 0b100000, 0b00000000, // phase  6, cycle 13
	0b000000, 0b100000, 0b00000000, // phase  6, cycle 14
	0b000000, 0b100000, 0b00000000, // phase  6, cycle 15
	0b000000, 0b100000, 0b00000000, // phase  6, cycle 16
	0b000000, 0b100000, 0b00000000, // phase  6, cycle 17
	0b000000, 0b100000, 0b00000000, // phase  6, cycle 18
	0b000000, 0b100000, 0b00000000, // phase  6, cycle 19
	0b000000, 0b100000, 0b00000000, // phase  6, cycle 20
	0b000000, 0b100000, 0b00000000, // phase  6, cycle 21
	0b000000, 0b100000, 0b00000000, // phase  6, cycle 22
	0b000000, 0b100000, 0b00000000, // phase  6, cycle 23
	0b000000, 0b100000, 0b00000000, // phase  6, cycle 24
	0b000000, 0b100000, 0b00000000, // phase  6, cycle 25
	0b000000, 0b100000, 0b00000000, // phase  6, cycle 26
	0b000000, 0b100000, 0b00000000, // phase  6, cycle 27
	0b000000, 0b100000, 0b00000000, // phase  6, cycle 28
	0b000000, 0b100000, 0b00000000, // phase  6, cycle 29
	0b000000, 0b100000, 0b00000000, // phase  6, cycle 30
	0b000000, 0b100000, 0b00000000, // phase  6, cycle 31
	0b000001, 0b111100, 0b00000000, // phase  7, cycle  0
	0b000000, 0b111000, 0b00000000, // phase  7, cycle  1
	0b000000, 0b111000, 0b00000000, // phase  7, cycle  2
	0b000000, 0b111000, 0b00000000, // phase  7, cycle  3
	0b000000, 0b111000, 0b00000000, // phase  7, cycle  4
	0b000000, 0b111000, 0b00000000, // phase  7, cycle  5
	0b000000, 0b111000, 0b00000000, // phase  7, cycle  6
	0b000000, 0b111000, 0b00000000, // phase  7, cycle  7
	0b000000, 0b010000, 0b00000000, // phase  7, cycle  8
	0b000000, 0b010000, 0b00000000, // phase  7, cycle  9
	0b000000, 0b010000, 0b00000000, // phase  7, cycle 10
	0b000000, 0b010000, 0b00000000, // phase  7, cycle 11
	0b000000, 0b010000, 0b00000000, // phase  7, cycle 12
	0b000000, 0b010000, 0b00000000, // phase  7, cycle 13
	0b000000, 0b010000, 0b00000000, // phase  7, cycle 14
	0b000000, 0b010000, 0b00000000, // phase  7, cycle 15
	0b000000, 0b010000, 0b00000000, // phase  7, cycle 16
	0b000000, 0b010000, 0b00000000, // phase  7, cycle 17
	0b000000, 0b010000, 0b00000000, // phase  7, cycle 18
	0b000000, 0b010000, 0b00000000, // phase  7, cycle 19
	0b000000, 0b010000, 0b00000000, // phase  7, cycle 20
	0b000000, 0b010000, 0b00000000, // phase  7, cycle 21
	0b000000, 0b010000, 0b00000000, // phase  7, cycle 22
	0b000000, 0b010000, 0b00000000, // phase  7, cycle 23
	0b000000, 0b010000, 0b00000000, // phase  7, cycle 24
	0b000000, 0b010000, 0b00000000, // phase  7, cycle 25
	0b000000, 0b010000, 0b00000000, // phase  7, cycle 26
	0b000000, 0b010000, 0b00000000, // phase  7, cycle 27
	0b000000, 0b010000, 0b00000000, // phase  7, cycle 28
	0b000000, 0b010000, 0b00000000, // phase  7, cycle 29
	0b000000, 0b010000, 0b00000000, // phase  7, cycle 30
	0b000000, 0b010000, 0b00000000, // phase  7, cycle 31
	0b000000, 0b111110, 0b00000000, // phase  8, cycle  0
	0b000000, 0b011100, 0b00000000, // phase  8, cycle  1
	0b000000, 0b011100, 0b00000000, // phase  8, cycle  2
	0b000000, 0b011100, 0b00000000, // phase  8, cycle  3
	0b000000, 0b011100, 0b00000000, // phase  8, cycle  4
	0b000000, 0b011100, 0b00000000, // phase  8, cycle  5
	0b000000, 0b011100, 0b00000000, // phase  8, cycle  6
	0b000000, 0b011100, 0b00000000, // phase  8, cycle  7
	0b000000, 0b001000, 0b00000000, // phase  8, cycle  8
	0b000000, 0b001000, 0b00000000, // phase  8, cycle  9
	0b000000, 0b001000, 0b00000000, // phase  8, cycle 10
	0b000000, 0b001000, 0b00000000, // phase  8, cycle 11
	0b000000, 0b001000, 0b00000000, // phase  8, cycle 12
	0b000000, 0b001000, 0b00000000, // phase  8, cycle 13
	0b000000, 0b001000, 0b00000000, // phase  8, cycle 14
	0b000000, 0b001000, 0b00000000, // phase  8, cycle 15
	0b000000, 0b001000, 0b00000000, // phase  8, cycle 16
	0b000000, 0b001000, 0b00000000, // phase  8, cycle 17
	0b000000, 0b001000, 0b00000000, // phase  8, cycle 18
	0b000000, 0b001000, 0b00000000, // phase  8, cycle 19
	0b000000, 0b001000, 0b00000000, // phase  8, cycle 20
	0b000000, 0b001000, 0b00000000, // phase  8, cycle 21
	0b000000, 0b001000, 0b00000000, // phase  8, cycle 22
	0b000000, 0b001000, 0b00000000, // phase  8, cycle 23
	0b000000, 0b001000, 0b00000000, // phase  8, cycle 24
	0b000000, 0b001000, 0b00000000, // phase  8, cycle 25
	0b000000, 0b001000, 0b00000000, // phase  8, cycle 26
	0b000000, 0b001000, 0b00000000, // phase  8, cycle 27
	0b000000, 0b001000, 0b00000000, // phase  8, cycle 28
	0b000000, 0b001000, 0b00000000, // phase  8, cycle 29
	0b000000, 0b001000, 0b00000000, // phase  8, cycle 30
	0b000000, 0b001000, 0b00000000, // phase  8, cycle 31
	0b000000, 0b011111, 0b00000000, // phase  9, cycle  0
	0b000000, 0b001110, 0b00000000, // phase  9, cycle  1
	0b000000, 0b001110, 0b00000000, // phase  9, cycle  2
	0b000000, 0b001110, 0b00000000, // phase  9, cycle  3
	0b000000, 0b001110, 0b00000000, // phase  9, cycle  4
	0b000000, 0b001110, 0b00000000, // phase  9, cycle  5
	0b000000, 0b001110, 0b00000000, // phase  9, cycle  6
	0b000000, 0b001110, 0b00000000, // phase  9, cycle  7
	0b000000, 0b000100, 0b00000000, // phase  9, cycle  8
	0b000000, 0b000100, 0b00000000, // phase  9, cycle  9
	0b000000, 0b000100, 0b00000000, // phase  9, cycle 10
	0b000000, 0b000100, 0b00000000, // phase  9, cycle 11
	0b000000, 0b000100, 0b00000000, // phase  9, cycle 12
	0b000000, 0b000100, 0b00000000, // phase  9, cycle 13
	0b000000, 0b000100, 0b00000000, // phase  9, cycle 14
	0b000000, 0b000100, 0b00000000, // phase  9, cycle 15
	0b000000, 0b000100, 0b00000000, // phase  9, cycle 16
	0b000000, 0b000100, 0b00000000, // phase  9, cycle 17
	0b000000, 0b000100, 0b00000000, // phase  9, cycle 18
	0b000000, 0b000100, 0b00000000, // phase  9, cycle 19
	0b000000, 0b000100, 0b00000000, // phase  9, cycle 20
	0b000000, 0b000100, 0b00000000, // phase  9, cycle 21
	0b000000, 0b000100, 0b00000000, // phase  9, cycle 22
	0b000000, 0b000100, 0b00000000, // phase  9, cycle 23
	0b000000, 0b000100, 0b00000000, // phase  9, cycle 24
	0b000000, 0b000100, 0b00000000, // phase  9, cycle 25
	0b000000, 0b000100, 0b00000000, // phase  9, cycle 26
	0b000000, 0b000100, 0b00000000, // phase  9, cycle 27
	0b000000, 0b000100, 0b00000000, // phase  9, cycle 28
	0b000000, 0b000100, 0b00000000, // phase  9, cycle 29
	0b000000, 0b000100, 0b00000000, // phase  9, cycle 30
	0b000000, 0b000100, 0b00000000, // phase  9, cycle 31
	0b000000, 0b001111, 0b10000000, // phase 10, cycle  0
	0b000000, 0b000111, 0b00000000, // phase 10, cycle  1
	0b000000, 0b000111, 0b00000000, // phase 10, cycle  2
	0b000000, 0b000111, 0b00000000, // phase 10, cycle  3
	0b000000, 0b000111, 0b00000000, // phase 10, cycle  4
	0b000000, 0b000111, 0b00000000, // phase 10, cycle  5
	0b000000, 0b000111, 0b00000000, // phase 10, cycle  6
	0b000000, 0b000111, 0b00000000, // phase 10, cycle  7
	0b000000, 0b000010, 0b00000000, // phase 10, cycle  8
	0b000000, 0b000010, 0b00000000, // phase 10, cycle  9
	0b000000, 0b000010, 0b00000000, // phase 10, cycle 10
	0b000000, 0b000010, 0b00000000, // phase 10, cycle 11
	0b000000, 0b000010, 0b00000000, // phase 10, cycle 12
	0b000000, 0b000010, 0b00000000, // phase 10, cycle 13
	0b000000, 0b000010, 0b00000000, // phase 10, cycle 14
	0b000000, 0b000010, 0b00000000, // phase 10, cycle 15
	0b000000, 0b000010, 0b00000000, // phase 10, cycle 16
	0b000000, 0b000010, 0b00000000, // phase 10, cycle 17
	0b000000, 0b000010, 0b00000000, // phase 10, cycle 18
	0b000000, 0b000010, 0b00000000, // phase 10, cycle 19
	0b000000, 0b000010, 0b00000000, // phase 10, cycle 20
	0b000000, 0b000010, 0b00000000, // phase 10, cycle 21
	0b000000, 0b000010, 0b00000000, // phase 10, cycle 22
	0b000000, 0b000010, 0b00000000, // phase 10, cycle 23
	0b000000, 0b000010, 0b00000000, // phase 10, cycle 24
	0b000000, 0b000010, 0b00000000, // phase 10, cycle 25
	0b000000, 0b000010, 0b00000000, // phase 10, cycle 26
	0b000000, 0b000010, 0b00000000, // phase 10, cycle 27
	0b000000, 0b000010, 0b00000000, // phase 10, cycle 28
	0b000000, 0b000010, 0b00000000, // phase 10, cycle 29
	0b000000, 0b000010, 0b00000000, // phase 10, cycle 30
	0b000000, 0b000010, 0b00000000, // phase 10, cycle 31
	0b000000, 0b000111, 0b11000000, // phase 11, cycle  0
	0b000000, 0b000011, 0b10000000, // phase 11, cycle  1
	0b000000, 0b000011, 0b10000000, // phase 11, cycle  2
	0b000000, 0b000011, 0b10000000, // phase 11, cycle  3
	0b000000, 0b000011, 0b10000000, // phase 11, cycle  4
	0b000000, 0b000011, 0b10000000, // phase 11, cycle  5
	0b000000, 0b000011, 0b10000000, // phase 11, cycle  6
	0b000000, 0b000011, 0b10000000, // phase 11, cycle  7
	0b000000, 0b000001, 0b00000000, // phase 11, cycle  8
	0b000000, 0b000001, 0b00000000, // phase 11, cycle  9
	0b000000, 0b000001, 0b00000000, // phase 11, cycle 10
	0b000000, 0b000001, 0b00000000, // phase 11, cycle 11
	0b000000, 0b000001, 0b00000000, // phase 11, cycle 12
	0b000000, 0b000001, 0b00000000, // phase 11, cycle 13
	0b000000, 0b000001, 0b00000000, // phase 11, cycle 14
	0b000000, 0b000001, 0b00000000, // phase 11, cycle 15
	0b000000, 0b000001, 0b00000000, // phase 11, cycle 16
	0b000000, 0b000001, 0b00000000, // phase 11, cycle 17
	0b000000, 0b000001, 0b00000000, // phase 11, cycle 18
	0b000000, 0b000001, 0b00000000, // phase 11, cycle 19
	0b000000, 0b000001, 0b00000000, // phase 11, cycle 20
	0b000000, 0b000001, 0b00000000, // phase 11, cycle 21
	0b000000, 0b000001, 0b00000000, // phase 11, cycle 22
	0b000000, 0b000001, 0b00000000, // phase 11, cycle 23
	0b000000, 0b000001, 0b00000000, // phase 11, cycle 24
	0b000000, 0b000001, 0b00000000, // phase 11, cycle 25
	0b000000, 0b000001, 0b00000000, // phase 11, cycle 26
	0b000000, 0b000001, 0b00000000, // phase 11, cycle 27
	0b000000, 0b000001, 0b00000000, // phase 11, cycle 28
	0b000000, 0b000001, 0b00000000, // phase 11, cycle 29
	0b000000, 0b000001, 0b00000000, // phase 11, cycle 30
	0b000000, 0b000001, 0b00000000, // phase 11, cycle 31
	0b000000, 0b000011, 0b11100000, // phase 12, cycle  0
	0b000000, 0b000001, 0b11000000, // phase 12, cycle  1
	0b000000, 0b000001, 0b11000000, // phase 12, cycle  2
	0b000000, 0b000001, 0b11000000, // phase 12, cycle  3
	0b000000, 0b000001, 0b11000000, // phase 12, cycle  4
	0b000000, 0b000001, 0b11000000, // phase 12, cycle  5
	0b000000, 0b000001, 0b11000000, // phase 12, cycle  6
	0b000000, 0b000001, 0b11000000, // phase 12, cycle  7
	0b000000, 0b000000, 0b10000000, // phase 12, cycle  8
	0b000000, 0b000000, 0b10000000, // phase 12, cycle  9
	0b000000, 0b000000, 0b10000000, // phase 12, cycle 10
	0b000000, 0b000000, 0b10000000, // phase 12, cycle 11
	0b000000, 0b000000, 0b10000000, // phase 12, cycle 12
	0b000000, 0b000000, 0b10000000, // phase 12, cycle 13
	0b000000, 0b000000, 0b10000000, // phase 12, cycle 14
	0b000000, 0b000000, 0b10000000, // phase 12, cycle 15
	0b000000, 0b000000, 0b10000000, // phase 12, cycle 16
	0b000000, 0b000000, 0b10000000, // phase 12, cycle 17
	0b000000, 0b000000, 0b10000000, // phase 12, cycle 18
	0b000000, 0b000000, 0b10000000, // phase 12, cycle 19
	0b000000, 0b000000, 0b10000000, // phase 12, cycle 20
	0b000000, 0b000000, 0b10000000, // phase 12, cycle 21
	0b000000, 0b000000, 0b10000000, // phase 12, cycle 22
	0b000000, 0b000000, 0b10000000, // phase 12, cycle 23
	0b000000, 0b000000, 0b10000000, // phase 12, cycle 24
	0b000000, 0b000000, 0b10000000, // phase 12, cycle 25
	0b000000, 0b000000, 0b10000000, // phase 12, cycle 26
	0b000000, 0b000000, 0b10000000, // phase 12, cycle 27
	0b000000, 0b000000, 0b10000000, // phase 12, cycle 28
	0b000000, 0b000000, 0b10000000, // phase 12, cycle 29
	0b000000, 0b000000, 0b10000000, // phase 12, cycle 30
	0b000000, 0b000000, 0b10000000, // phase 12, cycle 31
	0b000000, 0b000001, 0b11110000, // phase 13, cycle  0
	0b000000, 0b000000, 0b11100000, // phase 13, cycle  1
	0b000000, 0b000000, 0b11100000, // phase 13, cycle  2
	0b000000, 0b000000, 0b11100000, // phase 13, cycle  3
	0b000000, 0b000000, 0b11100000, // phase 13, cycle  4
	0b000000, 0b000000, 0b11100000, // phase 13, cycle  5
	0b000000, 0b000000, 0b11100000, // phase 13, cycle  6
	0b000000, 0b000000, 0b11100000, // phase 13, cycle  7
	0b000000, 0b000000, 0b01000000, // phase 13, cycle  8
	0b000000, 0b000000, 0b01000000, // phase 13, cycle  9
	0b000000, 0b000000, 0b01000000, // phase 13, cycle 10
	0b000000, 0b000000, 0b01000000, // phase 13, cycle 11
	0b000000, 0b000000, 0b01000000, // phase 13, cycle 12
	0b000000, 0b000000, 0b01000000, // phase 13, cycle 13
	0b000000, 0b000000, 0b01000000, // phase 13, cycle 14
	0b000000, 0b000000, 0b01000000, // phase 13, cycle 15
	0b000000, 0b000000, 0b01000000, // phase 13, cycle 16
	0b000000, 0b000000, 0b01000000, // phase 13, cycle 17
	0b000000, 0b000000, 0b01000000, // phase 13, cycle 18
	0b000000, 0b000000, 0b01000000, // phase 13, cycle 19
	0b000000, 0b000000, 0b01000000, // phase 13, cycle 20
	0b000000, 0b000000, 0b01000000, // phase 13, cycle 21
	0b000000, 0b000000, 0b01000000, // phase 13, cycle 22
	0b000000, 0b000000, 0b01000000, // phase 13, cycle 23
	0b000000, 0b000000, 0b01000000, // phase 13, cycle 24
	0b000000, 0b000000, 0b01000000, // phase 13, cycle 25
	0b000000, 0b000000, 0b01000000, // phase 13, cycle 26
	0b000000, 0b000000, 0b01000000, // phase 13, cycle 27
	0b000000, 0b000000, 0b01000000, // phase 13, cycle 28
	0b000000, 0b000000, 0b01000000, // phase 13, cycle 29
	0b000000, 0b000000, 0b01000000, // phase 13, cycle 30
	0b000000, 0b000000, 0b01000000, // phase 13, cycle 31
	0b000000, 0b000000, 0b11111000, // phase 14, cycle  0
	0b000000, 0b000000, 0b01110000, // phase 14, cycle  1
	0b000000, 0b000000, 0b01110000, // phase 14, cycle  2
	0b000000, 0b000000, 0b01110000, // phase 14, cycle  3
	0b000000, 0b000000, 0b01110000, // phase 14, cycle  4
	0b000000, 0b000000, 0b01110000, // phase 14, cycle  5
	0b000000, 0b000000, 0b01110000, // phase 14, cycle  6
	0b000000, 0b000000, 0b01110000, // phase 14, cycle  7
	0b000000, 0b000000, 0b00100000, // phase 14, cycle  8
	0b000000, 0b000000, 0b00100000, // phase 14, cycle  9
	0b000000, 0b000000, 0b00100000, // phase 14, cycle 10
	0b000000, 0b000000, 0b00100000, // phase 14, cycle 11
	0b000000, 0b000000, 0b00100000, // phase 14, cycle 12
	0b000000, 0b000000, 0b00100000, // phase 14, cycle 13
	0b000000, 0b000000, 0b00100000, // phase 14, cycle 14
	0b000000, 0b000000, 0b00100000, // phase 14, cycle 15
	0b000000, 0b000000, 0b00100000, // phase 14, cycle 16
	0b000000, 0b000000, 0b00100000, // phase 14, cycle 17
	0b000000, 0b000000, 0b00100000, // phase 14, cycle 18
	0b000000, 0b000000, 0b00100000, // phase 14, cycle 19
	0b000000, 0b000000, 0b00100000, // phase 14, cycle 20
	0b000000, 0b000000, 0b00100000, // phase 14, cycle 21
	0b000000, 0b000000, 0b00100000, // phase 14, cycle 22
	0b000000, 0b000000, 0b00100000, // phase 14, cycle 23
	0b000000, 0b000000, 0b00100000, // phase 14, cycle 24
	0b000000, 0b000000, 0b00100000, // phase 14, cycle 25
	0b000000, 0b000000, 0b00100000, // phase 14, cycle 26
	0b000000, 0b000000, 0b00100000, // phase 14, cycle 27
	0b000000, 0b000000, 0b00100000, // phase 14, cycle 28
	0b000000, 0b000000, 0b00100000, // phase 14, cycle 29
	0b000000, 0b000000, 0b00100000, // phase 14, cycle 30
	0b000000, 0b000000, 0b00100000, // phase 14, cycle 31
	0b000000, 0b000000, 0b01111100, // phase 15, cycle  0
	0b000000, 0b000000, 0b00111000, // phase 15, cycle  1
	0b000000, 0b000000, 0b00111000, // phase 15, cycle  2
	0b000000, 0b000000, 0b00111000, // phase 15, cycle  3
	0b000000, 0b000000, 0b00111000, // phase 15, cycle  4
	0b000000, 0b000000, 0b00111000, // phase 15, cycle  5
	0b000000, 0b000000, 0b00111000, // phase 15, cycle  6
	0b000000, 0b000000, 0b00111000, // phase 15, cycle  7
	0b000000, 0b000000, 0b00010000, // phase 15, cycle  8
	0b000000, 0b000000, 0b00010000, // phase 15, cycle  9
	0b000000, 0b000000, 0b00010000, // phase 15, cycle 10
	0b000000, 0b000000, 0b00010000, // phase 15, cycle 11
	0b000000, 0b000000, 0b00010000, // phase 15, cycle 12
	0b000000, 0b000000, 0b00010000, // phase 15, cycle 13
	0b000000, 0b000000, 0b00010000, // phase 15, cycle 14
	0b000000, 0b000000, 0b00010000, // phase 15, cycle 15
	0b000000, 0b000000, 0b00010000, // phase 15, cycle 16
	0b000000, 0b000000, 0b00010000, // phase 15, cycle 17
	0b000000, 0b000000, 0b00010000, // phase 15, cycle 18
	0b000000, 0b000000, 0b00010000, // phase 15, cycle 19
	0b000000, 0b000000, 0b00010000, // phase 15, cycle 20
	0b000000, 0b000000, 0b00010000, // phase 15, cycle 21
	0b000000, 0b000000, 0b00010000, // phase 15, cycle 22
	0b000000, 0b000000, 0b00010000, // phase 15, cycle 23
	0b000000, 0b000000, 0b00010000, // phase 15, cycle 24
	0b000000, 0b000000, 0b00010000, // phase 15, cycle 25
	0b000000, 0b000000, 0b00010000, // phase 15, cycle 26
	0b000000, 0b000000, 0b00010000, // phase 15, cycle 27
	0b000000, 0b000000, 0b00010000, // phase 15, cycle 28
	0b000000, 0b000000, 0b00010000, // phase 15, cycle 29
	0b000000, 0b000000, 0b00010000, // phase 15, cycle 30
	0b000000, 0b000000, 0b00010000, // phase 15, cycle 31
	0b000000, 0b000000, 0b00111110, // phase 16, cycle  0
	0b000000, 0b000000, 0b00011100, // phase 16, cycle  1
	0b000000, 0b000000, 0b00011100, // phase 16, cycle  2
	0b000000, 0b000000, 0b00011100, // phase 16, cycle  3
	0b000000, 0b000000, 0b00011100, // phase 16, cycle  4
	0b000000, 0b000000, 0b00011100, // phase 16, cycle  5
	0b000000, 0b000000, 0b00011100, // phase 16, cycle  6
	0b000000, 0b000000, 0b00011100, // phase 16, cycle  7
	0b000000, 0b000000, 0b00001000, // phase 16, cycle  8
	0b000000, 0b000000, 0b00001000, // phase 16, cycle  9
	0b000000, 0b000000, 0b00001000, // phase 16, cycle 10
	0b000000, 0b000000, 0b00001000, // phase 16, cycle 11
	0b000000, 0b000000, 0b00001000, // phase 16, cycle 12
	0b000000, 0b000000, 0b00001000, // phase 16, cycle 13
	0b000000, 0b000000, 0b00001000, // phase 16, cycle 14
	0b000000, 0b000000, 0b00001000, // phase 16, cycle 15
	0b000000, 0b000000, 0b00001000, // phase 16, cycle 16
	0b000000, 0b000000, 0b00001000, // phase 16, cycle 17
	0b000000, 0b000000, 0b00001000, // phase 16, cycle 18
	0b000000, 0b000000, 0b00001000, // phase 16, cycle 19
	0b000000, 0b000000, 0b00001000, // phase 16, cycle 20
	0b000000, 0b000000, 0b00001000, // phase 16, cycle 21
	0b000000, 0b000000, 0b00001000, // phase 16, cycle 22
	0b000000, 0b000000, 0b00001000, // phase 16, cycle 23
	0b000000, 0b000000, 0b00001000, // phase 16, cycle 24
	0b000000, 0b000000, 0b00001000, // phase 16, cycle 25
	0b000000, 0b000000, 0b00001000, // phase 16, cycle 26
	0b000000, 0b000000, 0b00001000, // phase 16, cycle 27
	0b000000, 0b000000, 0b00001000, // phase 16, cycle 28
	0b000000, 0b000000, 0b00001000, // phase 16, cycle 29
	0b000000, 0b000000, 0b00001000, // phase 16, cycle 30
	0b000000, 0b000000, 0b00001000, // phase 16, cycle 31
	0b000000, 0b000000, 0b00011111, // phase 17, cycle  0
	0b000000, 0b000000, 0b00001110, // phase 17, cycle  1
	0b000000, 0b000000, 0b00001110, // phase 17, cycle  2
	0b000000, 0b000000, 0b00001110, // phase 17, cycle  3
	0b000000, 0b000000, 0b00001110, // phase 17, cycle  4
	0b000000, 0b000000, 0b00001110, // phase 17, cycle  5
	0b000000, 0b000000, 0b00001110, // phase 17, cycle  6
	0b000000, 0b000000, 0b00001110, // phase 17, cycle  7
	0b000000, 0b000000, 0b00000100, // phase 17, cycle  8
	0b000000, 0b000000, 0b00000100, // phase 17, cycle  9
	0b000000, 0b000000, 0b00000100, // phase 17, cycle 10
	0b000000, 0b000000, 0b00000100, // phase 17, cycle 11
	0b000000, 0b000000, 0b00000100, // phase 17, cycle 12
	0b000000, 0b000000, 0b00000100, // phase 17, cycle 13
	0b000000, 0b000000, 0b00000100, // phase 17, cycle 14
	0b000000, 0b000000, 0b00000100, // phase 17, cycle 15
	0b000000, 0b000000, 0b00000100, // phase 17, cycle 16
	0b000000, 0b000000, 0b00000100, // phase 17, cycle 17
	0b000000, 0b000000, 0b00000100, // phase 17, cycle 18
	0b000000, 0b000000, 0b00000100, // phase 17, cycle 19
	0b000000, 0b000000, 0b00000100, // phase 17, cycle 20
	0b000000, 0b000000, 0b00000100, // phase 17, cycle 21
	0b000000, 0b000000, 0b00000100, // phase 17, cycle 22
	0b000000, 0b000000, 0b00000100, // phase 17, cycle 23
	0b000000, 0b000000, 0b00000100, // phase 17, cycle 24
	0b000000, 0b000000, 0b00000100, // phase 17, cycle 25
	0b000000, 0b000000, 0b00000100, // phase 17, cycle 26
	0b000000, 0b000000, 0b00000100, // phase 17, cycle 27
	0b000000, 0b000000, 0b00000100, // phase 17, cycle 28
	0b000000, 0b000000, 0b00000100, // phase 17, cycle 29
	0b000000, 0b000000, 0b00000100, // phase 17, cycle 30
	0b000000, 0b000000, 0b00000100, // phase 17, cycle 31
	0b000000, 0b000000, 0b00001111, // phase 18, cycle  0
	0b000000, 0b000000, 0b00000111, // phase 18, cycle  1
	0b000000, 0b000000, 0b00000111, // phase 18, cycle  2
	0b000000, 0b000000, 0b00000111, // phase 18, cycle  3
	0b000000, 0b000000, 0b00000111, // phase 18, cycle  4
	0b000000, 0b000000, 0b00000111, // phase 18, cycle  5
	0b000000, 0b000000, 0b00000111, // phase 18, cycle  6
	0b000000, 0b000000, 0b00000111, // phase 18, cycle  7
	0b000000, 0b000000, 0b00000010, // phase 18, cycle  8
	0b000000, 0b000000, 0b00000010, // phase 18, cycle  9
	0b000000, 0b000000, 0b00000010, // phase 18, cycle 10
	0b000000, 0b000000, 0b00000010, // phase 18, cycle 11
	0b000000, 0b000000, 0b00000010, // phase 18, cycle 12
	0b000000, 0b000000, 0b00000010, // phase 18, cycle 13
	0b000000, 0b000000, 0b00000010, // phase 18, cycle 14
	0b000000, 0b000000, 0b00000010, // phase 18, cycle 15
	0b000000, 0b000000, 0b00000010, // phase 18, cycle 16
	0b000000, 0b000000, 0b00000010, // phase 18, cycle 17
	0b000000, 0b000000, 0b00000010, // phase 18, cycle 18
	0b000000, 0b000000, 0b00000010, // phase 18, cycle 19
	0b000000, 0b000000, 0b00000010, // phase 18, cycle 20
	0b000000, 0b000000, 0b00000010, // phase 18, cycle 21
	0b000000, 0b000000, 0b00000010, // phase 18, cycle 22
	0b000000, 0b000000, 0b00000010, // phase 18, cycle 23
	0b000000, 0b000000, 0b00000010, // phase 18, cycle 24
	0b000000, 0b000000, 0b00000010, // phase 18, cycle 25
	0b000000, 0b000000, 0b00000010, // phase 18, cycle 26
	0b000000, 0b000000, 0b00000010, // phase 18, cycle 27
	0b000000, 0b000000, 0b00000010, // phase 18, cycle 28
	0b000000, 0b000000, 0b00000010, // phase 18, cycle 29
	0b000000, 0b000000, 0b00000010, // phase 18, cycle 30
	0b000000, 0b000000, 0b00000010, // phase 18, cycle 31
	0b000000, 0b000000, 0b00000011, // phase 19, cycle  0
	0b000000, 0b000000, 0b00000001, // phase 19, cycle  1
	0b000000, 0b000000, 0b00000001, // phase 19, cycle  2
	0b000000, 0b000000, 0b00000001, // phase 19, cycle  3
	0b000000, 0b000000, 0b00000001, // phase 19, cycle  4
	0b000000, 0b000000, 0b00000001, // phase 19, cycle  5
	0b000000, 0b000000, 0b00000001, // phase 19, cycle  6
	0b000000, 0b000000, 0b00000001, // phase 19, cycle  7
	0b000000, 0b000000, 0b00000000, // phase 19, cycle  8
	0b000000, 0b000000, 0b00000000, // phase 19, cycle  9
	0b000000, 0b000000, 0b00000000, // phase 19, cycle 10
	0b000000, 0b000000, 0b00000000, // phase 19, cycle 11
	0b000000, 0b000000, 0b00000000, // phase 19, cycle 12
	0b000000, 0b000000, 0b00000000, // phase 19, cycle 13
	0b000000, 0b000000, 0b00000000, // phase 19, cycle 14
	0b000000, 0b000000, 0b00000000, // phase 19, cycle 15
	0b000000, 0b000000, 0b00000000, // phase 19, cycle 16
	0b000000, 0b000000, 0b00000000, // phase 19, cycle 17
	0b000000, 0b000000, 0b00000000, // phase 19, cycle 18
	0b000000, 0b000000, 0b00000000, // phase 19, cycle 19
	0b000000, 0b000000, 0b00000000, // phase 19, cycle 20
	0b000000, 0b000000, 0b00000000, // phase 19, cycle 21
	0b000000, 0b000000, 0b00000000, // phase 19, cycle 22
	0b000000, 0b000000, 0b00000000, // phase 19, cycle 23
	0b000000, 0b000000, 0b00000000, // phase 19, cycle 24
	0b000000, 0b000000, 0b00000000, // phase 19, cycle 25
	0b000000, 0b000000, 0b00000000, // phase 19, cycle 26
	0b000000, 0b000000, 0b00000000, // phase 19, cycle 27
	0b000000, 0b000000, 0b00000000, // phase 19, cycle 28
	0b000000, 0b000000, 0b00000000, // phase 19, cycle 29
	0b000000, 0b000000, 0b00000000, // phase 19, cycle 30
	0b000000, 0b000000, 0b00000000, // phase 19, cycle 31
	0b000000, 0b000000, 0b00000111, // phase 20, cycle  0
	0b000000, 0b000000, 0b00000011, // phase 20, cycle  1
	0b000000, 0b000000, 0b00000011, // phase 20, cycle  2
	0b000000, 0b000000, 0b00000011, // phase 20, cycle  3
	0b000000, 0b000000, 0b00000011, // phase 20, cycle  4
	0b000000, 0b000000, 0b00000011, // phase 20, cycle  5
	0b000000, 0b000000, 0b00000011, // phase 20, cycle  6
	0b000000, 0b000000, 0b00000011, // phase 20, cycle  7
	0b000000, 0b000000, 0b00000001, // phase 20, cycle  8
	0b000000, 0b000000, 0b00000001, // phase 20, cycle  9
	0b000000, 0b000000, 0b00000001, // phase 20, cycle 10
	0b000000, 0b000000, 0b00000001, // phase 20, cycle 11
	0b000000, 0b000000, 0b00000001, // phase 20, cycle 12
	0b000000, 0b000000, 0b00000001, // phase 20, cycle 13
	0b000000, 0b000000, 0b00000001, // phase 20, cycle 14
	0b000000, 0b000000, 0b00000001, // phase 20, cycle 15
	0b000000, 0b000000, 0b00000001, // phase 20, cycle 16
	0b000000, 0b000000, 0b00000001, // phase 20, cycle 17
	0b000000, 0b000000, 0b00000001, // phase 20, cycle 18
	0b000000, 0b000000, 0b00000001, // phase 20, cycle 19
	0b000000, 0b000000, 0b00000001, // phase 20, cycle 20
	0b000000, 0b000000, 0b00000001, // phase 20, cycle 21
	0b000000, 0b000000, 0b00000001, // phase 20, cycle 22
	0b000000, 0b000000, 0b00000001, // phase 20, cycle 23
	0b000000, 0b000000, 0b00000001, // phase 20, cycle 24
	0b000000, 0b000000, 0b00000001, // phase 20, cycle 25
	0b000000, 0b000000, 0b00000001, // phase 20, cycle 26
	0b000000, 0b000000, 0b00000001, // phase 20, cycle 27
	0b000000, 0b000000, 0b00000001, // phase 20, cycle 28
	0b000000, 0b000000, 0b00000001, // phase 20, cycle 29
	0b000000, 0b000000, 0b00000001, // phase 20, cycle 30
	0b000000, 0b000000, 0b00000001, // phase 20, cycle 31
	0b000000, 0b000000, 0b00001111, // phase 21, cycle  0
	0b000000, 0b000000, 0b00000111, // phase 21, cycle  1
	0b000000, 0b000000, 0b00000111, // phase 21, cycle  2
	0b000000, 0b000000, 0b00000111, // phase 21, cycle  3
	0b000000, 0b000000, 0b00000111, // phase 21, cycle  4
	0b000000, 0b000000, 0b00000111, // phase 21, cycle  5
	0b000000, 0b000000, 0b00000111, // phase 21, cycle  6
	0b000000, 0b000000, 0b00000111, // phase 21, cycle  7
	0b000000, 0b000000, 0b00000010, // phase 21, cycle  8
	0b000000, 0b000000, 0b00000010, // phase 21, cycle  9
	0b000000, 0b000000, 0b00000010, // phase 21, cycle 10
	0b000000, 0b000000, 0b00000010, // phase 21, cycle 11
	0b000000, 0b000000, 0b00000010, // phase 21, cycle 12
	0b000000, 0b000000, 0b00000010, // phase 21, cycle 13
	0b000000, 0b000000, 0b00000010, // phase 21, cycle 14
	0b000000, 0b000000, 0b00000010, // phase 21, cycle 15
	0b000000, 0b000000, 0b00000010, // phase 21, cycle 16
	0b000000, 0b000000, 0b00000010, // phase 21, cycle 17
	0b000000, 0b000000, 0b00000010, // phase 21, cycle 18
	0b000000, 0b000000, 0b00000010, // phase 21, cycle 19
	0b000000, 0b000000, 0b00000010, // phase 21, cycle 20
	0b000000, 0b000000, 0b00000010, // phase 21, cycle 21
	0b000000, 0b000000, 0b00000010, // phase 21, cycle 22
	0b000000, 0b000000, 0b00000010, // phase 21, cycle 23
	0b000000, 0b000000, 0b00000010, // phase 21, cycle 24
	0b000000, 0b000000, 0b00000010, // phase 21, cycle 25
	0b000000, 0b000000, 0b00000010, // phase 21, cycle 26
	0b000000, 0b000000, 0b00000010, // phase 21, cycle 27
	0b000000, 0b000000, 0b00000010, // phase 21, cycle 28
	0b000000, 0b000000, 0b00000010, // phase 21, cycle 29
	0b000000, 0b000000, 0b00000010, // phase 21, cycle 30
	0b000000, 0b000000, 0b00000010, // phase 21, cycle 31
	0b000000, 0b000000, 0b00011111, // phase 22, cycle  0
	0b000000, 0b000000, 0b00001110, // phase 22, cycle  1
	0b000000, 0b000000, 0b00001110, // phase 22, cycle  2
	0b000000, 0b000000, 0b00001110, // phase 22, cycle  3
	0b000000, 0b000000, 0b00001110, // phase 22, cycle  4
	0b000000, 0b000000, 0b00001110, // phase 22, cycle  5
	0b000000, 0b000000, 0b00001110, // phase 22, cycle  6
	0b000000, 0b000000, 0b00001110, // phase 22, cycle  7
	0b000000, 0b000000, 0b00000100, // phase 22, cycle  8
	0b000000, 0b000000, 0b00000100, // phase 22, cycle  9
	0b000000, 0b000000, 0b00000100, // phase 22, cycle 10
	0b000000, 0b000000, 0b00000100, // phase 22, cycle 11
	0b000000, 0b000000, 0b00000100, // phase 22, cycle 12
	0b000000, 0b000000, 0b00000100, // phase 22, cycle 13
	0b000000, 0b000000, 0b00000100, // phase 22, cycle 14
	0b000000, 0b000000, 0b00000100, // phase 22, cycle 15
	0b000000, 0b000000, 0b00000100, // phase 22, cycle 16
	0b000000, 0b000000, 0b00000100, // phase 22, cycle 17
	0b000000, 0b000000, 0b00000100, // phase 22, cycle 18
	0b000000, 0b000000, 0b00000100, // phase 22, cycle 19
	0b000000, 0b000000, 0b00000100, // phase 22, cycle 20
	0b000000, 0b000000, 0b00000100, // phase 22, cycle 21
	0b000000, 0b000000, 0b00000100, // phase 22, cycle 22
	0b000000, 0b000000, 0b00000100, // phase 22, cycle 23
	0b000000, 0b000000, 0b00000100, // phase 22, cycle 24
	0b000000, 0b000000, 0b00000100, // phase 22, cycle 25
	0b000000, 0b000000, 0b00000100, // phase 22, cycle 26
	0b000000, 0b000000, 0b00000100, // phase 22, cycle 27
	0b000000, 0b000000, 0b00000100, // phase 22, cycle 28
	0b000000, 0b000000, 0b00000100, // phase 22, cycle 29
	0b000000, 0b000000, 0b00000100, // phase 22, cycle 30
	0b000000, 0b000000, 0b00000100, // phase 22, cycle 31
	0b000000, 0b000000, 0b00111110, // phase 23, cycle  0
	0b000000, 0b000000, 0b00011100, // phase 23, cycle  1
	0b000000, 0b000000, 0b00011100, // phase 23, cycle  2
	0b000000, 0b000000, 0b00011100, // phase 23, cycle  3
	0b000000, 0b000000, 0b00011100, // phase 23, cycle  4
	0b000000, 0b000000, 0b00011100, // phase 23, cycle  5
	0b000000, 0b000000, 0b00011100, // phase 23, cycle  6
	0b000000, 0b000000, 0b00011100, // phase 23, cycle  7
	0b000000, 0b000000, 0b00001000, // phase 23, cycle  8
	0b000000, 0b000000, 0b00001000, // phase 23, cycle  9
	0b000000, 0b000000, 0b00001000, // phase 23, cycle 10
	0b000000, 0b000000, 0b00001000, // phase 23, cycle 11
	0b000000, 0b000000, 0b00001000, // phase 23, cycle 12
	0b000000, 0b000000, 0b00001000, // phase 23, cycle 13
	0b000000, 0b000000, 0b00001000, // phase 23, cycle 14
	0b000000, 0b000000, 0b00001000, // phase 23, cycle 15
	0b000000, 0b000000, 0b00001000, // phase 23, cycle 16
	0b000000, 0b000000, 0b00001000, // phase 23, cycle 17
	0b000000, 0b000000, 0b00001000, // phase 23, cycle 18
	0b000000, 0b000000, 0b00001000, // phase 23, cycle 19
	0b000000, 0b000000, 0b00001000, // phase 23, cycle 20
	0b000000, 0b000000, 0b00001000, // phase 23, cycle 21
	0b000000, 0b000000, 0b00001000, // phase 23, cycle 22
	0b000000, 0b000000, 0b00001000, // phase 23, cycle 23
	0b000000, 0b000000, 0b00001000, // phase 23, cycle 24
	0b000000, 0b000000, 0b00001000, // phase 23, cycle 25
	0b000000, 0b000000, 0b00001000, // phase 23, cycle 26
	0b000000, 0b000000, 0b00001000, // phase 23, cycle 27
	0b000000, 0b000000, 0b00001000, // phase 23, cycle 28
	0b000000, 0b000000, 0b00001000, // phase 23, cycle 29
	0b000000, 0b000000, 0b00001000, // phase 23, cycle 30
	0b000000, 0b000000, 0b00001000, // phase 23, cycle 31
	0b000000, 0b000000, 0b01111100, // phase 24, cycle  0
	0b000000, 0b000000, 0b00111000, // phase 24, cycle  1
	0b000000, 0b000000, 0b00111000, // phase 24, cycle  2
	0b000000, 0b000000, 0b00111000, // phase 24, cycle  3
	0b000000, 0b000000, 0b00111000, // phase 24, cycle  4
	0b000000, 0b000000, 0b00111000, // phase 24, cycle  5
	0b000000, 0b000000, 0b00111000, // phase 24, cycle  6
	0b000000, 0b000000, 0b00111000, // phase 24, cycle  7
	0b000000, 0b000000, 0b00010000, // phase 24, cycle  8
	0b000000, 0b000000, 0b00010000, // phase 24, cycle  9
	0b000000, 0b000000, 0b00010000, // phase 24, cycle 10
	0b000000, 0b000000, 0b00010000, // phase 24, cycle 11
	0b000000, 0b000000, 0b00010000, // phase 24, cycle 12
	0b000000, 0b000000, 0b00010000, // phase 24, cycle 13
	0b000000, 0b000000, 0b00010000, // phase 24, cycle 14
	0b000000, 0b000000, 0b00010000, // phase 24, cycle 15
	0b000000, 0b000000, 0b00010000, // phase 24, cycle 16
	0b000000, 0b000000, 0b00010000, // phase 24, cycle 17
	0b000000, 0b000000, 0b00010000, // phase 24, cycle 18
	0b000000, 0b000000, 0b00010000, // phase 24, cycle 19
	0b000000, 0b000000, 0b00010000, // phase 24, cycle 20
	0b000000, 0b000000, 0b00010000, // phase 24, cycle 21
	0b000000, 0b000000, 0b00010000, // phase 24, cycle 22
	0b000000, 0b000000, 0b00010000, // phase 24, cycle 23
	0b000000, 0b000000, 0b00010000, // phase 24, cycle 24
	0b000000, 0b000000, 0b00010000, // phase 24, cycle 25
	0b000000, 0b000000, 0b00010000, // phase 24, cycle 26
	0b000000, 0b000000, 0b00010000, // phase 24, cycle 27
	0b000000, 0b000000, 0b00010000, // phase 24, cycle 28
	0b000000, 0b000000, 0b00010000, // phase 24, cycle 29
	0b000000, 0b000000, 0b00010000, // phase 24, cycle 30
	0b000000, 0b000000, 0b00010000, // phase 24, cycle 31
	0b000000, 0b000000, 0b11111000, // phase 25, cycle  0
	0b000000, 0b000000, 0b01110000, // phase 25, cycle  1
	0b000000, 0b000000, 0b01110000, // phase 25, cycle  2
	0b000000, 0b000000, 0b01110000, // phase 25, cycle  3
	0b000000, 0b000000, 0b01110000, // phase 25, cycle  4
	0b000000, 0b000000, 0b01110000, // phase 25, cycle  5
	0b000000, 0b000000, 0b01110000, // phase 25, cycle  6
	0b000000, 0b000000, 0b01110000, // phase 25, cycle  7
	0b000000, 0b000000, 0b00100000, // phase 25, cycle  8
	0b000000, 0b000000, 0b00100000, // phase 25, cycle  9
	0b000000, 0b000000, 0b00100000, // phase 25, cycle 10
	0b000000, 0b000000, 0b00100000, // phase 25, cycle 11
	0b000000, 0b000000, 0b00100000, // phase 25, cycle 12
	0b000000, 0b000000, 0b00100000, // phase 25, cycle 13
	0b000000, 0b000000, 0b00100000, // phase 25, cycle 14
	0b000000, 0b000000, 0b00100000, // phase 25, cycle 15
	0b000000, 0b000000, 0b00100000, // phase 25, cycle 16
	0b000000, 0b000000, 0b00100000, // phase 25, cycle 17
	0b000000, 0b000000, 0b00100000, // phase 25, cycle 18
	0b000000, 0b000000, 0b00100000, // phase 25, cycle 19
	0b000000, 0b000000, 0b00100000, // phase 25, cycle 20
	0b000000, 0b000000, 0b00100000, // phase 25, cycle 21
	0b000000, 0b000000, 0b00100000, // phase 25, cycle 22
	0b000000, 0b000000, 0b00100000, // phase 25, cycle 23
	0b000000, 0b000000, 0b00100000, // phase 25, cycle 24
	0b000000, 0b000000, 0b00100000, // phase 25, cycle 25
	0b000000, 0b000000, 0b00100000, // phase 25, cycle 26
	0b000000, 0b000000, 0b00100000, // phase 25, cycle 27
	0b000000, 0b000000, 0b00100000, // phase 25, cycle 28
	0b000000, 0b000000, 0b00100000, // phase 25, cycle 29
	0b000000, 0b000000, 0b00100000, // phase 25, cycle 30
	0b000000, 0b000000, 0b00100000, // phase 25, cycle 31
	0b000000, 0b000001, 0b11110000, // phase 26, cycle  0
	0b000000, 0b000000, 0b11100000, // phase 26, cycle  1
	0b000000, 0b000000, 0b11100000, // phase 26, cycle  2
	0b000000, 0b000000, 0b11100000, // phase 26, cycle  3
	0b000000, 0b000000, 0b11100000, // phase 26, cycle  4
	0b000000, 0b000000, 0b11100000, // phase 26, cycle  5
	0b000000, 0b000000, 0b11100000, // phase 26, cycle  6
	0b000000, 0b000000, 0b11100000, // phase 26, cycle  7
	0b000000, 0b000000, 0b01000000, // phase 26, cycle  8
	0b000000, 0b000000, 0b01000000, // phase 26, cycle  9
	0b000000, 0b000000, 0b01000000, // phase 26, cycle 10
	0b000000, 0b000000, 0b01000000, // phase 26, cycle 11
	0b000000, 0b000000, 0b01000000, // phase 26, cycle 12
	0b000000, 0b000000, 0b01000000, // phase 26, cycle 13
	0b000000, 0b000000, 0b01000000, // phase 26, cycle 14
	0b000000, 0b000000, 0b01000000, // phase 26, cycle 15
	0b000000, 0b000000, 0b01000000, // phase 26, cycle 16
	0b000000, 0b000000, 0b01000000, // phase 26, cycle 17
	0b000000, 0b000000, 0b01000000, // phase 26, cycle 18
	0b000000, 0b000000, 0b01000000, // phase 26, cycle 19
	0b000000, 0b000000, 0b01000000, // phase 26, cycle 20
	0b000000, 0b000000, 0b01000000, // phase 26, cycle 21
	0b000000, 0b000000, 0b01000000, // phase 26, cycle 22
	0b000000, 0b000000, 0b01000000, // phase 26, cycle 23
	0b000000, 0b000000, 0b01000000, // phase 26, cycle 24
	0b000000, 0b000000, 0b01000000, // phase 26, cycle 25
	0b000000, 0b000000, 0b01000000, // phase 26, cycle 26
	0b000000, 0b000000, 0b01000000, // phase 26, cycle 27
	0b000000, 0b000000, 0b01000000, // phase 26, cycle 28
	0b000000, 0b000000, 0b01000000, // phase 26, cycle 29
	0b000000, 0b000000, 0b01000000, // phase 26, cycle 30
	0b000000, 0b000000, 0b01000000, // phase 26, cycle 31
	0b000000, 0b000011, 0b11100000, // phase 27, cycle  0
	0b000000, 0b000001, 0b11000000, // phase 27, cycle  1
	0b000000, 0b000001, 0b11000000, // phase 27, cycle  2
	0b000000, 0b000001, 0b11000000, // phase 27, cycle  3
	0b000000, 0b000001, 0b11000000, // phase 27, cycle  4
	0b000000, 0b000001, 0b11000000, // phase 27, cycle  5
	0b000000, 0b000001, 0b11000000, // phase 27, cycle  6
	0b000000, 0b000001, 0b11000000, // phase 27, cycle  7
	0b000000, 0b000000, 0b10000000, // phase 27, cycle  8
	0b000000, 0b000000, 0b10000000, // phase 27, cycle  9
	0b000000, 0b000000, 0b10000000, // phase 27, cycle 10
	0b000000, 0b000000, 0b10000000, // phase 27, cycle 11
	0b000000, 0b000000, 0b10000000, // phase 27, cycle 12
	0b000000, 0b000000, 0b10000000, // phase 27, cycle 13
	0b000000, 0b000000, 0b10000000, // phase 27, cycle 14
	0b000000, 0b000000, 0b10000000, // phase 27, cycle 15
	0b000000, 0b000000, 0b10000000, // phase 27, cycle 16
	0b000000, 0b000000, 0b10000000, // phase 27, cycle 17
	0b000000, 0b000000, 0b10000000, // phase 27, cycle 18
	0b000000, 0b000000, 0b10000000, // phase 27, cycle 19
	0b000000, 0b000000, 0b10000000, // phase 27, cycle 20
	0b000000, 0b000000, 0b10000000, // phase 27, cycle 21
	0b000000, 0b000000, 0b10000000, // phase 27, cycle 22
	0b000000, 0b000000, 0b10000000, // phase 27, cycle 23
	0b000000, 0b000000, 0b10000000, // phase 27, cycle 24
	0b000000, 0b000000, 0b10000000, // phase 27, cycle 25
	0b000000, 0b000000, 0b10000000, // phase 27, cycle 26
	0b000000, 0b000000, 0b10000000, // phase 27, cycle 27
	0b000000, 0b000000, 0b10000000, // phase 27, cycle 28
	0b000000, 0b000000, 0b10000000, // phase 27, cycle 29
	0b000000, 0b000000, 0b10000000, // phase 27, cycle 30
	0b000000, 0b000000, 0b10000000, // phase 27, cycle 31
	0b000000, 0b000111, 0b11000000, // phase 28, cycle  0
	0b000000, 0b000011, 0b10000000, // phase 28, cycle  1
	0b000000, 0b000011, 0b10000000, // phase 28, cycle  2
	0b000000, 0b000011, 0b10000000, // phase 28, cycle  3
	0b000000, 0b000011, 0b10000000, // phase 28, cycle  4
	0b000000, 0b000011, 0b10000000, // phase 28, cycle  5
	0b000000, 0b000011, 0b10000000, // phase 28, cycle  6
	0b000000, 0b000011, 0b10000000, // phase 28, cycle  7
	0b000000, 0b000001, 0b00000000, // phase 28, cycle  8
	0b000000, 0b000001, 0b00000000, // phase 28, cycle  9
	0b000000, 0b000001, 0b00000000, // phase 28, cycle 10
	0b000000, 0b000001, 0b00000000, // phase 28, cycle 11
	0b000000, 0b000001, 0b00000000, // phase 28, cycle 12
	0b000000, 0b000001, 0b00000000, // phase 28, cycle 13
	0b000000, 0b000001, 0b00000000, // phase 28, cycle 14
	0b000000, 0b000001, 0b00000000, // phase 28, cycle 15
	0b000000, 0b000001, 0b00000000, // phase 28, cycle 16
	0b000000, 0b000001, 0b00000000, // phase 28, cycle 17
	0b000000, 0b000001, 0b00000000, // phase 28, cycle 18
	0b000000, 0b000001, 0b00000000, // phase 28, cycle 19
	0b000000, 0b000001, 0b00000000, // phase 28, cycle 20
	0b000000, 0b000001, 0b00000000, // phase 28, cycle 21
	0b000000, 0b000001, 0b00000000, // phase 28, cycle 22
	0b000000, 0b000001, 0b00000000, // phase 28, cycle 23
	0b000000, 0b000001, 0b00000000, // phase 28, cycle 24
	0b000000, 0b000001, 0b00000000, // phase 28, cycle 25
	0b000000, 0b000001, 0b00000000, // phase 28, cycle 26
	0b000000, 0b000001, 0b00000000, // phase 28, cycle 27
	0b000000, 0b000001, 0b00000000, // phase 28, cycle 28
	0b000000, 0b000001, 0b00000000, // phase 28, cycle 29
	0b000000, 0b000001, 0b00000000, // phase 28, cycle 30
	0b000000, 0b000001, 0b00000000, // phase 28, cycle 31
	0b000000, 0b001111, 0b10000000, // phase 29, cycle  0
	0b000000, 0b000111, 0b00000000, // phase 29, cycle  1
	0b000000, 0b000111, 0b00000000, // phase 29, cycle  2
	0b000000, 0b000111, 0b00000000, // phase 29, cycle  3
	0b000000, 0b000111, 0b00000000, // phase 29, cycle  4
	0b000000, 0b000111, 0b00000000, // phase 29, cycle  5
	0b000000, 0b000111, 0b00000000, // phase 29, cycle  6
	0b000000, 0b000111, 0b00000000, // phase 29, cycle  7
	0b000000, 0b000010, 0b00000000, // phase 29, cycle  8
	0b000000, 0b000010, 0b00000000, // phase 29, cycle  9
	0b000000, 0b000010, 0b00000000, // phase 29, cycle 10
	0b000000, 0b000010, 0b00000000, // phase 29, cycle 11
	0b000000, 0b000010, 0b00000000, // phase 29, cycle 12
	0b000000, 0b000010, 0b00000000, // phase 29, cycle 13
	0b000000, 0b000010, 0b00000000, // phase 29, cycle 14
	0b000000, 0b000010, 0b00000000, // phase 29, cycle 15
	0b000000, 0b000010, 0b00000000, // phase 29, cycle 16
	0b000000, 0b000010, 0b00000000, // phase 29, cycle 17
	0b000000, 0b000010, 0b00000000, // phase 29, cycle 18
	0b000000, 0b000010, 0b00000000, // phase 29, cycle 19
	0b000000, 0b000010, 0b00000000, // phase 29, cycle 20
	0b000000, 0b000010, 0b00000000, // phase 29, cycle 21
	0b000000, 0b000010, 0b00000000, // phase 29, cycle 22
	0b000000, 0b000010, 0b00000000, // phase 29, cycle 23
	0b000000, 0b000010, 0b00000000, // phase 29, cycle 24
	0b000000, 0b000010, 0b00000000, // phase 29, cycle 25
	0b000000, 0b000010, 0b00000000, // phase 29, cycle 26
	0b000000, 0b000010, 0b00000000, // phase 29, cycle 27
	0b000000, 0b000010, 0b00000000, // phase 29, cycle 28
	0b000000, 0b000010, 0b00000000, // phase 29, cycle 29
	0b000000, 0b000010, 0b00000000, // phase 29, cycle 30
	0b000000, 0b000010, 0b00000000, // phase 29, cycle 31
	0b000000, 0b011111, 0b00000000, // phase 30, cycle  0
	0b000000, 0b001110, 0b00000000, // phase 30, cycle  1
	0b000000, 0b001110, 0b00000000, // phase 30, cycle  2
	0b000000, 0b001110, 0b00000000, // phase 30, cycle  3
	0b000000, 0b001110, 0b00000000, // phase 30, cycle  4
	0b000000, 0b001110, 0b00000000, // phase 30, cycle  5
	0b000000, 0b001110, 0b00000000, // phase 30, cycle  6
	0b000000, 0b001110, 0b00000000, // phase 30, cycle  7
	0b000000, 0b000100, 0b00000000, // phase 30, cycle  8
	0b000000, 0b000100, 0b00000000, // phase 30, cycle  9
	0b000000, 0b000100, 0b00000000, // phase 30, cycle 10
	0b000000, 0b000100, 0b00000000, // phase 30, cycle 11
	0b000000, 0b000100, 0b00000000, // phase 30, cycle 12
	0b000000, 0b000100, 0b00000000, // phase 30, cycle 13
	0b000000, 0b000100, 0b00000000, // phase 30, cycle 14
	0b000000, 0b000100, 0b00000000, // phase 30, cycle 15
	0b000000, 0b000100, 0b00000000, // phase 30, cycle 16
	0b000000, 0b000100, 0b00000000, // phase 30, cycle 17
	0b000000, 0b000100, 0b00000000, // phase 30, cycle 18
	0b000000, 0b000100, 0b00000000, // phase 30, cycle 19
	0b000000, 0b000100, 0b00000000, // phase 30, cycle 20
	0b000000, 0b000100, 0b00000000, // phase 30, cycle 21
	0b000000, 0b000100, 0b00000000, // phase 30, cycle 22
	0b000000, 0b000100, 0b00000000, // phase 30, cycle 23
	0b000000, 0b000100, 0b00000000, // phase 30, cycle 24
	0b000000, 0b000100, 0b00000000, // phase 30, cycle 25
	0b000000, 0b000100, 0b00000000, // phase 30, cycle 26
	0b000000, 0b000100, 0b00000000, // phase 30, cycle 27
	0b000000, 0b000100, 0b00000000, // phase 30, cycle 28
	0b000000, 0b000100, 0b00000000, // phase 30, cycle 29
	0b000000, 0b000100, 0b00000000, // phase 30, cycle 30
	0b000000, 0b000100, 0b00000000, // phase 30, cycle 31
	0b000000, 0b111110, 0b00000000, // phase 31, cycle  0
	0b000000, 0b011100, 0b00000000, // phase 31, cycle  1
	0b000000, 0b011100, 0b00000000, // phase 31, cycle  2
	0b000000, 0b011100, 0b00000000, // phase 31, cycle  3
	0b000000, 0b011100, 0b00000000, // phase 31, cycle  4
	0b000000, 0b011100, 0b00000000, // phase 31, cycle  5
	0b000000, 0b011100, 0b00000000, // phase 31, cycle  6
	0b000000, 0b011100, 0b00000000, // phase 31, cycle  7
	0b000000, 0b001000, 0b00000000, // phase 31, cycle  8
	0b000000, 0b001000, 0b00000000, // phase 31, cycle  9
	0b000000, 0b001000, 0b00000000, // phase 31, cycle 10
	0b000000, 0b001000, 0b00000000, // phase 31, cycle 11
	0b000000, 0b001000, 0b00000000, // phase 31, cycle 12
	0b000000, 0b001000, 0b00000000, // phase 31, cycle 13
	0b000000, 0b001000, 0b00000000, // phase 31, cycle 14
	0b000000, 0b001000, 0b00000000, // phase 31, cycle 15
	0b000000, 0b001000, 0b00000000, // phase 31, cycle 16
	0b000000, 0b001000, 0b00000000, // phase 31, cycle 17
	0b000000, 0b001000, 0b00000000, // phase 31, cycle 18
	0b000000, 0b001000, 0b00000000, // phase 31, cycle 19
	0b000000, 0b001000, 0b00000000, // phase 31, cycle 20
	0b000000, 0b001000, 0b00000000, // phase 31, cycle 21
	0b000000, 0b001000, 0b00000000, // phase 31, cycle 22
	0b000000, 0b001000, 0b00000000, // phase 31, cycle 23
	0b000000, 0b001000, 0b00000000, // phase 31, cycle 24
	0b000000, 0b001000, 0b00000000, // phase 31, cycle 25
	0b000000, 0b001000, 0b00000000, // phase 31, cycle 26
	0b000000, 0b001000, 0b00000000, // phase 31, cycle 27
	0b000000, 0b001000, 0b00000000, // phase 31, cycle 28
	0b000000, 0b001000, 0b00000000, // phase 31, cycle 29
	0b000000, 0b001000, 0b00000000, // phase 31, cycle 30
	0b000000, 0b001000, 0b00000000, // phase 31, cycle 31
	0b000001, 0b111100, 0b00000000, // phase 32, cycle  0
	0b000000, 0b111000, 0b00000000, // phase 32, cycle  1
	0b000000, 0b111000, 0b00000000, // phase 32, cycle  2
	0b000000, 0b111000, 0b00000000, // phase 32, cycle  3
	0b000000, 0b111000, 0b00000000, // phase 32, cycle  4
	0b000000, 0b111000, 0b00000000, // phase 32, cycle  5
	0b000000, 0b111000, 0b00000000, // phase 32, cycle  6
	0b000000, 0b111000, 0b00000000, // phase 32, cycle  7
	0b000000, 0b010000, 0b00000000, // phase 32, cycle  8
	0b000000, 0b010000, 0b00000000, // phase 32, cycle  9
	0b000000, 0b010000, 0b00000000, // phase 32, cycle 10
	0b000000, 0b010000, 0b00000000, // phase 32, cycle 11
	0b000000, 0b010000, 0b00000000, // phase 32, cycle 12
	0b000000, 0b010000, 0b00000000, // phase 32, cycle 13
	0b000000, 0b010000, 0b00000000, // phase 32, cycle 14
	0b000000, 0b010000, 0b00000000, // phase 32, cycle 15
	0b000000, 0b010000, 0b00000000, // phase 32, cycle 16
	0b000000, 0b010000, 0b00000000, // phase 32, cycle 17
	0b000000, 0b010000, 0b00000000, // phase 32, cycle 18
	0b000000, 0b010000, 0b00000000, // phase 32, cycle 19
	0b000000, 0b010000, 0b00000000, // phase 32, cycle 20
	0b000000, 0b010000, 0b00000000, // phase 32, cycle 21
	0b000000, 0b010000, 0b00000000, // phase 32, cycle 22
	0b000000, 0b010000, 0b00000000, // phase 32, cycle 23
	0b000000, 0b010000, 0b00000000, // phase 32, cycle 24
	0b000000, 0b010000, 0b00000000, // phase 32, cycle 25
	0b000000, 0b010000, 0b00000000, // phase 32, cycle 26
	0b000000, 0b010000, 0b00000000, // phase 32, cycle 27
	0b000000, 0b010000, 0b00000000, // phase 32, cycle 28
	0b000000, 0b010000, 0b00000000, // phase 32, cycle 29
	0b000000, 0b010000, 0b00000000, // phase 32, cycle 30
	0b000000, 0b010000, 0b00000000, // phase 32, cycle 31
	0b000011, 0b111000, 0b00000000, // phase 33, cycle  0
	0b000001, 0b110000, 0b00000000, // phase 33, cycle  1
	0b000001, 0b110000, 0b00000000, // phase 33, cycle  2
	0b000001, 0b110000, 0b00000000, // phase 33, cycle  3
	0b000001, 0b110000, 0b00000000, // phase 33, cycle  4
	0b000001, 0b110000, 0b00000000, // phase 33, cycle  5
	0b000001, 0b110000, 0b00000000, // phase 33, cycle  6
	0b000001, 0b110000, 0b00000000, // phase 33, cycle  7
	0b000000, 0b100000, 0b00000000, // phase 33, cycle  8
	0b000000, 0b100000, 0b00000000, // phase 33, cycle  9
	0b000000, 0b100000, 0b00000000, // phase 33, cycle 10
	0b000000, 0b100000, 0b00000000, // phase 33, cycle 11
	0b000000, 0b100000, 0b00000000, // phase 33, cycle 12
	0b000000, 0b100000, 0b00000000, // phase 33, cycle 13
	0b000000, 0b100000, 0b00000000, // phase 33, cycle 14
	0b000000, 0b100000, 0b00000000, // phase 33, cycle 15
	0b000000, 0b100000, 0b00000000, // phase 33, cycle 16
	0b000000, 0b100000, 0b00000000, // phase 33, cycle 17
	0b000000, 0b100000, 0b00000000, // phase 33, cycle 18
	0b000000, 0b100000, 0b00000000, // phase 33, cycle 19
	0b000000, 0b100000, 0b00000000, // phase 33, cycle 20
	0b000000, 0b100000, 0b00000000, // phase 33, cycle 21
	0b000000, 0b100000, 0b00000000, // phase 33, cycle 22
	0b000000, 0b100000, 0b00000000, // phase 33, cycle 23
	0b000000, 0b100000, 0b00000000, // phase 33, cycle 24
	0b000000, 0b100000, 0b00000000, // phase 33, cycle 25
	0b000000, 0b100000, 0b00000000, // phase 33, cycle 26
	0b000000, 0b100000, 0b00000000, // phase 33, cycle 27
	0b000000, 0b100000, 0b00000000, // phase 33, cycle 28
	0b000000, 0b100000, 0b00000000, // phase 33, cycle 29
	0b000000, 0b100000, 0b00000000, // phase 33, cycle 30
	0b000000, 0b100000, 0b00000000, // phase 33, cycle 31
	0b000111, 0b110000, 0b00000000, // phase 34, cycle  0
	0b000011, 0b100000, 0b00000000, // phase 34, cycle  1
	0b000011, 0b100000, 0b00000000, // phase 34, cycle  2
	0b000011, 0b100000, 0b00000000, // phase 34, cycle  3
	0b000011, 0b100000, 0b00000000, // phase 34, cycle  4
	0b000011, 0b100000, 0b00000000, // phase 34, cycle  5
	0b000011, 0b100000, 0b00000000, // phase 34, cycle  6
	0b000011, 0b100000, 0b00000000, // phase 34, cycle  7
	0b000001, 0b000000, 0b00000000, // phase 34, cycle  8
	0b000001, 0b000000, 0b00000000, // phase 34, cycle  9
	0b000001, 0b000000, 0b00000000, // phase 34, cycle 10
	0b000001, 0b000000, 0b00000000, // phase 34, cycle 11
	0b000001, 0b000000, 0b00000000, // phase 34, cycle 12
	0b000001, 0b000000, 0b00000000, // phase 34, cycle 13
	0b000001, 0b000000, 0b00000000, // phase 34, cycle 14
	0b000001, 0b000000, 0b00000000, // phase 34, cycle 15
	0b000001, 0b000000, 0b00000000, // phase 34, cycle 16
	0b000001, 0b000000, 0b00000000, // phase 34, cycle 17
	0b000001, 0b000000, 0b00000000, // phase 34, cycle 18
	0b000001, 0b000000, 0b00000000, // phase 34, cycle 19
	0b000001, 0b000000, 0b00000000, // phase 34, cycle 20
	0b000001, 0b000000, 0b00000000, // phase 34, cycle 21
	0b000001, 0b000000, 0b00000000, // phase 34, cycle 22
	0b000001, 0b000000, 0b00000000, // phase 34, cycle 23
	0b000001, 0b000000, 0b00000000, // phase 34, cycle 24
	0b000001, 0b000000, 0b00000000, // phase 34, cycle 25
	0b000001, 0b000000, 0b00000000, // phase 34, cycle 26
	0b000001, 0b000000, 0b00000000, // phase 34, cycle 27
	0b000001, 0b000000, 0b00000000, // phase 34, cycle 28
	0b000001, 0b000000, 0b00000000, // phase 34, cycle 29
	0b000001, 0b000000, 0b00000000, // phase 34, cycle 30
	0b000001, 0b000000, 0b00000000, // phase 34, cycle 31
	0b001111, 0b100000, 0b00000000, // phase 35, cycle  0
	0b000111, 0b000000, 0b00000000, // phase 35, cycle  1
	0b000111, 0b000000, 0b00000000, // phase 35, cycle  2
	0b000111, 0b000000, 0b00000000, // phase 35, cycle  3
	0b000111, 0b000000, 0b00000000, // phase 35, cycle  4
	0b000111, 0b000000, 0b00000000, // phase 35, cycle  5
	0b000111, 0b000000, 0b00000000, // phase 35, cycle  6
	0b000111, 0b000000, 0b00000000, // phase 35, cycle  7
	0b000010, 0b000000, 0b00000000, // phase 35, cycle  8
	0b000010, 0b000000, 0b00000000, // phase 35, cycle  9
	0b000010, 0b000000, 0b00000000, // phase 35, cycle 10
	0b000010, 0b000000, 0b00000000, // phase 35, cycle 11
	0b000010, 0b000000, 0b00000000, // phase 35, cycle 12
	0b000010, 0b000000, 0b00000000, // phase 35, cycle 13
	0b000010, 0b000000, 0b00000000, // phase 35, cycle 14
	0b000010, 0b000000, 0b00000000, // phase 35, cycle 15
	0b000010, 0b000000, 0b00000000, // phase 35, cycle 16
	0b000010, 0b000000, 0b00000000, // phase 35, cycle 17
	0b000010, 0b000000, 0b00000000, // phase 35, cycle 18
	0b000010, 0b000000, 0b00000000, // phase 35, cycle 19
	0b000010, 0b000000, 0b00000000, // phase 35, cycle 20
	0b000010, 0b000000, 0b00000000, // phase 35, cycle 21
	0b000010, 0b000000, 0b00000000, // phase 35, cycle 22
	0b000010, 0b000000, 0b00000000, // phase 35, cycle 23
	0b000010, 0b000000, 0b00000000, // phase 35, cycle 24
	0b000010, 0b000000, 0b00000000, // phase 35, cycle 25
	0b000010, 0b000000, 0b00000000, // phase 35, cycle 26
	0b000010, 0b000000, 0b00000000, // phase 35, cycle 27
	0b000010, 0b000000, 0b00000000, // phase 35, cycle 28
	0b000010, 0b000000, 0b00000000, // phase 35, cycle 29
	0b000010, 0b000000, 0b00000000, // phase 35, cycle 30
	0b000010, 0b000000, 0b00000000, // phase 35, cycle 31
	0b011111, 0b000000, 0b00000000, // phase 36, cycle  0
	0b001110, 0b000000, 0b00000000, // phase 36, cycle  1
	0b001110, 0b000000, 0b00000000, // phase 36, cycle  2
	0b001110, 0b000000, 0b00000000, // phase 36, cycle  3
	0b001110, 0b000000, 0b00000000, // phase 36, cycle  4
	0b001110, 0b000000, 0b00000000, // phase 36, cycle  5
	0b001110, 0b000000, 0b00000000, // phase 36, cycle  6
	0b001110, 0b000000, 0b00000000, // phase 36, cycle  7
	0b000100, 0b000000, 0b00000000, // phase 36, cycle  8
	0b000100, 0b000000, 0b00000000, // phase 36, cycle  9
	0b000100, 0b000000, 0b00000000, // phase 36, cycle 10
	0b000100, 0b000000, 0b00000000, // phase 36, cycle 11
	0b000100, 0b000000, 0b00000000, // phase 36, cycle 12
	0b000100, 0b000000, 0b00000000, // phase 36, cycle 13
	0b000100, 0b000000, 0b00000000, // phase 36, cycle 14
	0b000100, 0b000000, 0b00000000, // phase 36, cycle 15
	0b000100, 0b000000, 0b00000000, // phase 36, cycle 16
	0b000100, 0b000000, 0b00000000, // phase 36, cycle 17
	0b000100, 0b000000, 0b00000000, // phase 36, cycle 18
	0b000100, 0b000000, 0b00000000, // phase 36, cycle 19
	0b000100, 0b000000, 0b00000000, // phase 36, cycle 20
	0b000100, 0b000000, 0b00000000, // phase 36, cycle 21
	0b000100, 0b000000, 0b00000000, // phase 36, cycle 22
	0b000100, 0b000000, 0b00000000, // phase 36, cycle 23
	0b000100, 0b000000, 0b00000000, // phase 36, cycle 24
	0b000100, 0b000000, 0b00000000, // phase 36, cycle 25
	0b000100, 0b000000, 0b00000000, // phase 36, cycle 26
	0b000100, 0b000000, 0b00000000, // phase 36, cycle 27
	0b000100, 0b000000, 0b00000000, // phase 36, cycle 28
	0b000100, 0b000000, 0b00000000, // phase 36, cycle 29
	0b000100, 0b000000, 0b00000000, // phase 36, cycle 30
	0b000100, 0b000000, 0b00000000, // phase 36, cycle 31
	0b111110, 0b000000, 0b00000000, // phase 37, cycle  0
	0b011100, 0b000000, 0b00000000, // phase 37, cycle  1
	0b011100, 0b000000, 0b00000000, // phase 37, cycle  2
	0b011100, 0b000000, 0b00000000, // phase 37, cycle  3
	0b011100, 0b000000, 0b00000000, // phase 37, cycle  4
	0b011100, 0b000000, 0b00000000, // phase 37, cycle  5
	0b011100, 0b000000, 0b00000000, // phase 37, cycle  6
	0b011100, 0b000000, 0b00000000, // phase 37, cycle  7
	0b001000, 0b000000, 0b00000000, // phase 37, cycle  8
	0b001000, 0b000000, 0b00000000, // phase 37, cycle  9
	0b001000, 0b000000, 0b00000000, // phase 37, cycle 10
	0b001000, 0b000000, 0b00000000, // phase 37, cycle 11
	0b001000, 0b000000, 0b00000000, // phase 37, cycle 12
	0b001000, 0b000000, 0b00000000, // phase 37, cycle 13
	0b001000, 0b000000, 0b00000000, // phase 37, cycle 14
	0b001000, 0b000000, 0b00000000, // phase 37, cycle 15
	0b001000, 0b000000, 0b00000000, // phase 37, cycle 16
	0b001000, 0b000000, 0b00000000, // phase 37, cycle 17
	0b001000, 0b000000, 0b00000000, // phase 37, cycle 18
	0b001000, 0b000000, 0b00000000, // phase 37, cycle 19
	0b001000, 0b000000, 0b00000000, // phase 37, cycle 20
	0b001000, 0b000000, 0b00000000, // phase 37, cycle 21
	0b001000, 0b000000, 0b00000000, // phase 37, cycle 22
	0b001000, 0b000000, 0b00000000, // phase 37, cycle 23
	0b001000, 0b000000, 0b00000000, // phase 37, cycle 24
	0b001000, 0b000000, 0b00000000, // phase 37, cycle 25
	0b001000, 0b000000, 0b00000000, // phase 37, cycle 26
	0b001000, 0b000000, 0b00000000, // phase 37, cycle 27
	0b001000, 0b000000, 0b00000000, // phase 37, cycle 28
	0b001000, 0b000000, 0b00000000, // phase 37, cycle 29
	0b001000, 0b000000, 0b00000000, // phase 37, cycle 30
	0b001000, 0b000000, 0b00000000, // phase 37, cycle 31
	0b111100, 0b000000, 0b00000000, // phase 38, cycle  0
	0b111000, 0b000000, 0b00000000, // phase 38, cycle  1
	0b111000, 0b000000, 0b00000000, // phase 38, cycle  2
	0b111000, 0b000000, 0b00000000, // phase 38, cycle  3
	0b111000, 0b000000, 0b00000000, // phase 38, cycle  4
	0b111000, 0b000000, 0b00000000, // phase 38, cycle  5
	0b111000, 0b000000, 0b00000000, // phase 38, cycle  6
	0b111000, 0b000000, 0b00000000, // phase 38, cycle  7
	0b010000, 0b000000, 0b00000000, // phase 38, cycle  8
	0b010000, 0b000000, 0b00000000, // phase 38, cycle  9
	0b010000, 0b000000, 0b00000000, // phase 38, cycle 10
	0b010000, 0b000000, 0b00000000, // phase 38, cycle 11
	0b010000, 0b000000, 0b00000000, // phase 38, cycle 12
	0b010000, 0b000000, 0b00000000, // phase 38, cycle 13
	0b010000, 0b000000, 0b00000000, // phase 38, cycle 14
	0b010000, 0b000000, 0b00000000, // phase 38, cycle 15
	0b010000, 0b000000, 0b00000000, // phase 38, cycle 16
	0b010000, 0b000000, 0b00000000, // phase 38, cycle 17
	0b010000, 0b000000, 0b00000000, // phase 38, cycle 18
	0b010000, 0b000000, 0b00000000, // phase 38, cycle 19
	0b010000, 0b000000, 0b00000000, // phase 38, cycle 20
	0b010000, 0b000000, 0b00000000, // phase 38, cycle 21
	0b010000, 0b000000, 0b00000000, // phase 38, cycle 22
	0b010000, 0b000000, 0b00000000, // phase 38, cycle 23
	0b010000, 0b000000, 0b00000000, // phase 38, cycle 24
	0b010000, 0b000000, 0b00000000, // phase 38, cycle 25
	0b010000, 0b000000, 0b00000000, // phase 38, cycle 26
	0b010000, 0b000000, 0b00000000, // phase 38, cycle 27
	0b010000, 0b000000, 0b00000000, // phase 38, cycle 28
	0b010000, 0b000000, 0b00000000, // phase 38, cycle 29
	0b010000, 0b000000, 0b00000000, // phase 38, cycle 30
	0b010000, 0b000000, 0b00000000, // phase 38, cycle 31
};

uint16_t ms_delay[period] = { 24, 19, 16, 14, 12, 11, 10, 10,  9,  9,  8,  8,  8,  7,  7,  7,  7,  6,  6,  6,  6,  6,  6,  7,  7,  7,  7,  8,  8,  8,  9,  9, 10, 10, 11, 12, 14, 16, 19,};

volatile uint16_t base_index = 0;

void iterate() {
	static uint8_t index = 0;
	static uint16_t counter = 0;

	if (counter < ms_delay[index]) {
		++counter;
	} else {
		counter = 0;

		base_index = index*(ports*brightness_levels);
		++index;
		if (index == period) {
			index = 0;
		}
	}
}

void setup() {
	DDRD = 0b11111111; // set digital  0- 7 to output
	DDRB = 0b00111111; // set digital  8-13 to output
	DDRC = 0b00111111; // set digital 14-19 to output (coincidences with analog 0-5)

	MsTimer2::set(2, iterate);
	MsTimer2::start();
}

void loop() {
	static uint16_t index;
	cli();
	index = base_index;
	sei();

	for (uint8_t cycle=0; cycle<brightness_levels; ++cycle) {
		PORTC = pgm_read_byte(pov_pattern+(index++));
		PORTB = pgm_read_byte(pov_pattern+(index++));
		PORTD = pgm_read_byte(pov_pattern+(index++));
	}
}

The result is a glowing bounce effect without any perceptible flicker.

This approach already resolves the flicker issue completely. However there are alternative solutions. Thus I will proceed with a Larson Scanner without flicker.

2 Responses to Glowing Bounce

  1. Michael says:

    Line 650..1257 could be omitted by using the first half of the array and simply decrementing the index back through the array. no?

    • You are definitely right. However my approach is slightly more general as it would even work for patterns without such a symmetry (in in time). So unless I would also have very tight ROM constraint I prefer it this way.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s