  ** ----------------------
  ** 
  ** This Sketch turns a Teensy 3.1, 3.2 or later into a controller for WS2811/WS2812 based led strips.
- ** This strip controller was originally designed supported by the Direct Output Framework, but since 
+ ** This strip controller was originally designed for use with the Direct Output Framework, but since 
  ** the communication protocol is simple and communication uses the virtual com port of the Teensy
  ** it should be easy to controll the strips from other applications as well.
  ** 

  leds.begin();
  leds.show();

}

//Main loop of the programm gets called again and again.

        Nack();
      break;
    }

   
    SetBlinkMode(1);
    
    
  } 
  Blink();
}


//Sets the mode for the blinking of the led
void SetBlinkMode(int Mode) {
  BlinkMode=Mode;
  BlinkModeTimeoutTimer=0;
}

//Controls the blinking of the led
void Blink() {
  switch(BlinkMode) {
    case 0:
      //Blinkmode 0 is only active after the start of the Teensy until the first command is received.
      if(BlinkTimer<1500) {
        digitalWrite(LedPin,0);
      } else if(BlinkTimer<1600) {
        digitalWrite(LedPin,1);
      } else {
        BlinkTimer=0;
        digitalWrite(LedPin,0);
      }
    break;
    case 1:
      //Blinkmode 1 is activated when the Teensy receives a command
      //Mode expires 500ms after the last command has been received resp. mode has been set
      if(BlinkTimer>30) {
        BlinkTimer=0;
        digitalWrite(LedPin,!digitalRead(LedPin));
      }
      if(BlinkModeTimeoutTimer>500) {
        SetBlinkMode(2);
      }
    break;   
    case 2:
      //Blinkmode 2 is active while the Teensy is waiting for more commands
      if(BlinkTimer<1500) {
        digitalWrite(LedPin,0);
      } else if(BlinkTimer<1600) {
        digitalWrite(LedPin,1);
      } else if(BlinkTimer<1700) {
        digitalWrite(LedPin,0);
      } else if(BlinkTimer<1800) {
        digitalWrite(LedPin,1);
      }else {
        BlinkTimer=0;
        digitalWrite(LedPin,0);
      }
      default:
      //This should never be active
      //The code is only here to make it easier to determine if a wrong Blinkcode has been set
      if(BlinkTimer>2000) {
        BlinkTimer=0;
        digitalWrite(LedPin,!digitalRead(LedPin));
      }
      break;
  }
  
}


//Outputs the data in the ram to the ledstrips
void OutputData() {
