   checkTimerTimeout();
   checkCloudBitInput();
   playClick();
-  playMelody();
+  playNextTone();
 }
 
 // decrease timerValue every one sec if timer is not stopped


// output to counter 7seg LED
void displayCounter() {
  // maps 6000 sec to 100 minutes on littleBits LED
  analogWrite(COUNTER_LED, map(timerValue, 0, 59, 0, 255));
//  analogWrite(COUNTER_LED, map(timerValue, 0, 5999, 0, 255));
}

// output to cloudBit when timer counting is finished
void checkTimerTimeout() {
  if (false && timerValue == 0 && timerValuePrev == 1) {
    analogWrite(CLOUDBIT_OUT, 255);
    delay(100);
    analogWrite(CLOUDBIT_OUT, 0);
    melodyCount = MAX_MELODY_COUNT;
  }
}

// check input from cloudBit to play alarm
void checkCloudBitInput() {
  int cloudBitInput = analogRead(CLOUDBIT_IN);
  if (cloudBitInput >= ANALOG_HIGH_THRETHOLD && !isCloudBitInputHigh) {
    isCloudBitInputHigh = true;
    melodyCount = MAX_MELODY_COUNT;
  }
  if (cloudBitInput < ANALOG_HIGH_THRETHOLD) {
    isCloudBitInputHigh = false;

  timerValuePrev = 0;
  isCloudBitInputHigh = false;
  melodyCount = 0;
  resetMelody();
}

// if start button is pressed, increase timerValue by START_VAL
