       // get a value
       if(BUFFER[i+1] == ':') {
         if(index == 0) {
-          type = buff;
+          TYPE = buff;
           index++;
         }
         else if(index == 1) {
-          looper = buff.toInt();
+          LOOP = buff.toInt();
           index++;
         }
         else if(index == 2) {
-          time = buff.toInt();
+          TIME = buff.toInt();
           index++;
         }
         buff = "";

      
      // get last value
      if(i == (BUFFER.length()-1)) {
        repeat = buff.toInt();
        REPEATING = true;
      }
    }
    BUFFER = "";
    
    Serial.println(type+":"+looper+":"+time+":"+repeat);
    btSerial.write(time);
    
    // validation
    // type["blink", "pulse"]
    // time[500, 250, 100, 50]
    // loop[1, 2, 3]
    // rept[30, 15, 5, 3]
    if(type == "blink") {
      blink(looper, time);
    }
    else if(type == "pulse") {
      blink(looper, time);
    }
    else if(type == "clear") {
      REPEATING = false;
    }
    else {
      blink(looper, time);
    }
  }
  

    TIME_START = millis();
    if(REPEATING) {
      Serial.println("repeat");
      blink(LOOP, TIME);
    }
  }
  
