   digitalWrite(SPEAKER_OUT, blinkerValue);
 }
 
-// output to counter 7seg LED
-void displayCounter() {
-  int counterValue = map(timerValue, 0, 5999, 0, 255); // maps 6000 sec to 100 minutes on littleBits LED
-  analogWrite(COUNTER_LED, counterValue);
-}
-
-// output to cloutBit when timer counting is finished
-void checkTimeout() {
-  if (timerValue == 0 && timerValuePrev == 1) {
-    analogWrite(CLOUDBIT_OUT, 255);
-    delay(100);
-    analogWrite(CLOUDBIT_OUT, 0);
-    melodyCount = MAX_MELODY_COUNT;
-  }
-}
-
 // play the melody if melodyCount > 0
 void playMelody() {  
   

const int SPEAKER_OUT = 1; // blinker LED and speaker output at D1
const int COUNTER_LED = 5; // counter 7-seg LED output at D5
const int CLOUDBIT_OUT = 9; // cloudBit output at D9

const int START_VAL = 20 * 60; // the unit amount for starting timer in seconds
const int MAX_VAL = 99 * 60; // max amount of timer in seconds

const int MAX_MELODY_COUNT = 1; // how many times melody will be played at alarming

// notes of "winny the pooh"


// setup
void setup() {
  pinMode(START_BTN, INPUT);
  pinMode(CLOUDBIT_IN, INPUT);
  pinMode(STOP_BTN, INPUT);
  pinMode(SPEAKER_OUT, OUTPUT);
  pinMode(COUNTER_LED, OUTPUT);
  pinMode(CLOUDBIT_OUT, OUTPUT);
