 SoftwareSerial btSerial(9, 10); // TX, RX
 
 // Global
-String BUFFER = "";
-int BUT = 2;
+int BUTT = 2;
 int BUTT_STATE = 0;
 int TIME_START = 0;
 int REDPIN = 6;


void setup()
{
  pinMode(BUT, INPUT);
  pinMode(REDPIN, OUTPUT);
  pinMode(GREPIN, OUTPUT);
  pinMode(BLUPIN, OUTPUT);

  int index = 0;
  if(btSerial.available()) {
    while(btSerial.available()) {
      API = btSerial.read();
      delay(1);
      R = btSerial.read();
      delay(1);
      G = btSerial.read();
      delay(1);
      B = btSerial.read();
      delay(1);
    }

    Serial.print("API:");
    Serial.print(API, DEC);
    Serial.print(", Binary:");
    Serial.println(API, BIN);
    
    // parse API
    REPT = 0;
    TIME = 0;
    NUMB = 0;
    TYPE = 0;
    
    REPT = API & 3;
    API >>= 2;
    TIME = API & 3;
    API >>= 2;
    NUMB = API & 3;
    API >>= 2;
    TYPE = API &3;

    Serial.print("TYPE:");
    Serial.print(TYPE, DEC);
    Serial.print(", Binary:");
    Serial.println(TYPE, BIN);
    
    Serial.print("NUMB:");
    Serial.print(NUMB, DEC);
    Serial.print(", Binary:");
    Serial.println(NUMB, BIN);
    
    Serial.print("TIME:");
    Serial.print(TIME, DEC);
    Serial.print(", Binary:");
    Serial.println(TIME, BIN);
    
    Serial.print("REPT:");
    Serial.print(REPT, DEC);
    Serial.print(", Binary:");
    Serial.println(REPT, BIN);
    
    Serial.print("R:");
    Serial.print(R, DEC);
