 
 // I rewrite this one from scrtach to use high resolution for the color wheel to look nicer on a *much* bigger string
                                                                             
-void rainbowCycle(unsigned char frames , unsigned int frameAdvance, unsigned int pixelAdvance ) {
+void rainbowCycle(uint8_t frames , unsigned int frameAdvance, unsigned int pixelAdvance ) {
   
   // Hue is a number between 0 and 3*256 than defines a mix of r->g->b where
   // hue of 0 = Full red

                // 100
                //case 4: // A -> B
                //r = 0;
                unsigned char twothirds = scale8( offset8, ((256 * 2) / 3));
                colors[1] = K171 - twothirds;
                colors[2] = K85  + twothirds;
            } else {

    ledsetup();
}

const uint8_t delta = (256/PIXELS); //delta of hue between each pixel, spread out evenly
volatile boolean constant=0;
volatile int8_t direction = 1;
//volatile uint8_t constant_color_hue=0;
uint8_t led_colors[PIXELS][3];
volatile uint8_t constant_color_index=0;


const uint8_t rgb_colors[8][3] {
255,0,0,
255,128,0,
255,255,0,
0,255,0,
0,255,255,
0,0,255,
255,0,255,
//255,128,128,
255,255,255
};

ISR(PCINT0_vect) {

    if (PINB & (1<<3)) { //change direction
        //transition between -1,0,1
        constant = 0;
        direction += 2;
        direction = direction % 3;
        direction -= 1;
    }
    else if (PINB & 1) { //constant color
        //stop color shifting
        constant = 1;
        //constant_color_hue += 32;
        ++constant_color_index % 8;
    }
}

void show_all_led_colors() {
    cli();  
    for (uint8_t index=0; index < PIXELS; index++) {
      sendPixel( led_colors[index][0] , led_colors[index][1] , led_colors[index][2] );
    }
    sei();
