         LIGHT_SMOOTH,
 };
 volatile int command = 0;
+volatile int repeated = 0;
 
 const char* command2string(int c) {
         switch (c) {

                    STROBE_FREQ = 3,
                    FLASH_FREQ = 4;

        static int mode = MODE_STATIC, strobe_on = 0;
        static float brightness = 1, time = 0, strobe = 0,
                     a_r = 0, a_g = 0, a_b = 0,
                     b_r = 0, b_g = 0, b_b = 0;

        int cmd = command;
        command = 0;

        //if (cmd) {
        //        Serial.print("IR command: ");
        //        Serial.println(command2string(cmd));
        //}

        float elapsed = timer3() * (1024 / 1.6e7);
        time += elapsed;

        switch (cmd) {
        case LIGHT_RED:
                a_r = 1;
                a_g = a_b = 0;
                mode = MODE_STATIC;
                break;
        case LIGHT_GREEN:
                a_r = a_b = 0;
                a_g = 1;
                mode = MODE_STATIC;
                break;
        case LIGHT_BLUE:
                a_r = a_g = 0;
                a_b = 1;
                mode = MODE_STATIC;
                break;
        case LIGHT_SMOOTH:
                mode = MODE_SMOOTH;
                break;
        case LIGHT_OFF:
                a_r = a_g = a_b = 0;
                mode = MODE_STATIC;
                break;
        case LIGHT_BRIGHTER:
                brightness += 0.05;
                if (brightness > 1)
                        brightness = 1;
                break;
        case LIGHT_DARKER:
                brightness -= 0.05;
                if (brightness < 0.05)
                        brightness = 0.05;
                break;
        case LIGHT_STROBE:
                strobe_on = !strobe_on;
                break;
        case LIGHT_FLASH:
                mode = MODE_FLASH;
                break;
        case LIGHT_FADE:
                mode = MODE_FADE;
                hsv2rgb(random(1e6)/1e6, 1, 1, &a_r, &a_g, &a_b);
                hsv2rgb(random(1e6)/1e6, 1, 1, &b_r, &b_g, &b_b);
                break;
        case 0:
                break;
        default:
                a_r = a_g = a_b = 1;
                mode = MODE_STATIC;
                break;
        }

        while (Serial.available() >= 6) {
                char data[6];
                for (int i = 0; i < sizeof (data); ++i)

        TCCR3C = 0;
        TCNT3 = 0;
        TIMSK3 = 0;

        Serial.println("Hello!");
}

void loop() {
