Servo with 3 pushbuttons and leds, each led in minutes and hours

I am using the code that you made, as I should start?, with star and then put the minutes or hours or direct start to set the minutes.
Because when I put the board to the arduino all the LEDs flash and the arduino turns, and then opromimo the first yellow led, it turns on but after 15 minutes nothing happens.
What do you recommend me?

#include <Servo.h>

boolean sessionStarted = false;
int hours = 0;
int MAX_HOURS = 3;
int HOURS_START_PIN = 5;
int minutes = 0;
int MAX_MINUTES = 3;
int MINUTES_START_PIN = 2;
boolean readingHoursInProgress = false;
boolean readingMinutesInProgress = false;
boolean readingSessionBtnInProgress = false;
unsigned long endTime = 0;
unsigned long MINUTES_MULTIPLIER = 60000; // 1000 por segundos, 60000 por minutos
unsigned long HOURS_MULTIPLIER = MINUTES_MULTIPLIER * 60;

Servo servo;

void setup() {

for (int pin = 2; pin <= 7; pin++) {
pinMode(pin, OUTPUT);
}
// SERVO
servo.attach(9);
servo.write(0);
delay(250);
}

void loop() {
if (!sessionStarted) {
readMinutes();
readHours();
showCurrentTime();
} else {
if (millis() > endTime) {
finishSession();
}
}

if (sessionStatusChanged()) {
if (!sessionStarted) {
startSession();
} else {
finishSession();
}
}
}

void finishSession() {
sessionStarted = false;
servo.write(170);
fleshLED();
servo.write(0);
}

void startSession() {
fleshLED();

sessionStarted = true;
endTime = minutes * 15 * MINUTES_MULTIPLIER;
endTime += hours * HOURS_MULTIPLIER;
endTime += millis();
}

void fleshLED() {
for (int i = 0; i < 5; i++) {
for (int pin = 2; pin <= 7; pin++) {
digitalWrite(pin, HIGH);
}
delay(500);
for (int pin = 2; pin <= 7; pin++) {
digitalWrite(pin, LOW);
}
delay(500);
}
}

boolean sessionStatusChanged() {
int sessionBtnInput = analogRead(A2);

if (!readingSessionBtnInProgress) {
if (sessionBtnInput > 1000) {
readingSessionBtnInProgress = true;
}
} else {
if (sessionBtnInput == 0) {
readingSessionBtnInProgress = false;

return true;
}
}

return false;
}

void readMinutes() {
int minInput = analogRead(A0);

if (!readingMinutesInProgress) {
if (minInput > 1000) {
minutes++;
if (minutes > MAX_MINUTES) {
minutes = 0;
}
readingMinutesInProgress = true;
}
} else {
if (minInput == 0) {
readingMinutesInProgress = false;
}
}
}

void readHours() {
int hrsInput = analogRead(A1);

if (!readingHoursInProgress) {
if (hrsInput > 1000) {
hours++;
if (hours > MAX_HOURS) {
hours = 0;
}
readingHoursInProgress = true;
}
} else {
if (hrsInput == 0) {
readingHoursInProgress = false;
}
}
}

void showCurrentTime() {
// show minutos
for (int pin = MINUTES_START_PIN; pin < MINUTES_START_PIN + MAX_MINUTES; pin++) {
digitalWrite(pin, pin < MINUTES_START_PIN + minutes ? HIGH : LOW);
}
// show horas
for (int pin = HOURS_START_PIN; pin < HOURS_START_PIN + MAX_HOURS; pin++) {
digitalWrite(pin, pin < HOURS_START_PIN + hours ? HIGH : LOW);
}
}

I am using the code that you made,

Who are you addressing? Who wrote this code?

See item nr. 7 in this link;
http://forum.arduino.cc/index.php/topic,148850.msg1118324.html#post_codetags
Or:
After you have typed your message, start the Arduino IDE if not already running and load or type in your code.
Right click in the editor window then left click [Select All].
Right click again then left click [Copy].
And, in the reply page, type:

[code]

Type or
paste your
code here

[/code]

Ok me, I was asked to re-upload the code in the forum, I hope they help me thanks

#include <Servo.h>

boolean sessionStarted = false;
int hours = 0;
int MAX_HOURS = 3;
int HOURS_START_PIN = 5;
int minutes = 0;
int MAX_MINUTES = 3;
int MINUTES_START_PIN = 2;
boolean readingHoursInProgress = false;
boolean readingMinutesInProgress = false;
boolean readingSessionBtnInProgress = false;
unsigned long endTime = 0;
unsigned long MINUTES_MULTIPLIER = 60000; // 1000 for seconds, 60000 for minutes
unsigned long HOURS_MULTIPLIER = MINUTES_MULTIPLIER * 60;

Servo servo;

void setup() {
  // put your setup code here, to run once:
  for (int pin = 2; pin <= 7; pin++) {
    pinMode(pin, OUTPUT);
  }
  // SERVO
  servo.attach(9);
  servo.write(0);
  delay(250);
}

void loop() {
  if (!sessionStarted) {
    readMinutes();  
    readHours();
    showCurrentTime();
  } else {
    if (millis() > endTime) {
      finishSession();
    }
  }

  if (sessionStatusChanged()) {
    if (!sessionStarted) {
      startSession();
    } else {
      finishSession();
    }
  }
}

void finishSession() {
  sessionStarted = false;
  servo.write(170);
  fleshLED();
  servo.write(0);
}

void startSession() {
  fleshLED();

  sessionStarted = true;
  endTime = minutes * 15 * MINUTES_MULTIPLIER;
  endTime += hours * HOURS_MULTIPLIER;
  endTime += millis();  
}

void fleshLED() {
  for (int i = 0; i < 5; i++) {
    for (int pin = 2; pin <= 7; pin++) {
      digitalWrite(pin, HIGH);
    }
    delay(500);
    for (int pin = 2; pin <= 7; pin++) {
      digitalWrite(pin, LOW);
    }
    delay(500);
  }
}

boolean sessionStatusChanged() {
  int sessionBtnInput = analogRead(A2);
  
  if (!readingSessionBtnInProgress) {
    if (sessionBtnInput > 1000) {
      readingSessionBtnInProgress = true;
    }
  } else {
    if (sessionBtnInput == 0) {
      readingSessionBtnInProgress = false;
      // react only after user releases button (can be implemented everywhere)
      return true;
    }
  }

  return false;
}

void readMinutes() {
  int minInput = analogRead(A0);
  
  if (!readingMinutesInProgress) {
    if (minInput > 1000) {
      minutes++;
      if (minutes > MAX_MINUTES) {
        minutes = 0;
      }
      readingMinutesInProgress = true;
    }
  } else {
    if (minInput == 0) {
      readingMinutesInProgress = false;
    }
  }
}

void readHours() {
  int hrsInput = analogRead(A1);

  if (!readingHoursInProgress) {
    if (hrsInput > 1000) {
      hours++;
      if (hours > MAX_HOURS) {
        hours = 0;
      }
      readingHoursInProgress = true;
    }
  } else {
    if (hrsInput == 0) {
      readingHoursInProgress = false;
    }
  }
}

void showCurrentTime() {
  // show minutes
  for (int pin = MINUTES_START_PIN; pin < MINUTES_START_PIN + MAX_MINUTES; pin++) {
    digitalWrite(pin, pin < MINUTES_START_PIN + minutes ? HIGH : LOW);    
  }
  // show hours
  for (int pin = HOURS_START_PIN; pin < HOURS_START_PIN + MAX_HOURS; pin++) {
    digitalWrite(pin, pin < HOURS_START_PIN + hours ? HIGH : LOW);
  }
}