#define button 3

#define LED 1
#define twoLED 2
#define threeLED 4
#define fourLED 5
#define fiveLED 6
#define sixLED 7
#define sevenLED 8
#define eightLED 9
#define nineLED 10
#define tenLED 11




int state = 0;
int old = 0;
int buttonPoll = 0;

void setup() {
  pinMode (3, INPUT_PULLUP);
  pinMode (11, OUTPUT);
  pinMode(LED, OUTPUT);
  pinMode(twoLED, OUTPUT);
  pinMode(threeLED, OUTPUT);
  pinMode(fourLED, OUTPUT);
  pinMode(fiveLED, OUTPUT);
  pinMode(sixLED, OUTPUT);
  pinMode(sevenLED, OUTPUT);
  pinMode(eightLED, OUTPUT);
  pinMode(nineLED, OUTPUT);
  pinMode(tenLED, OUTPUT);


  digitalWrite(LED, LOW);
  digitalWrite(twoLED, LOW);
  digitalWrite(threeLED, LOW);
  digitalWrite(fourLED, LOW);
  digitalWrite(fiveLED, LOW);
  digitalWrite(sixLED, LOW);
  digitalWrite(sevenLED, LOW);
  digitalWrite(eightLED, LOW);
  digitalWrite(nineLED, LOW);
  digitalWrite(tenLED, LOW);

}

void loop() {



  while (state == old)
  {
    buttonPoll = digitalRead (3);
    if (buttonPoll == 1)
    {
      delay (50);
      buttonPoll = digitalRead (3);
      if (buttonPoll == 0)
      {
        state = old + 1;
      }
    }
    else
    {
      delay(100);
    }
  }

  switch (state) {
    case 1:
      digitalWrite(LED, HIGH);
      digitalWrite(twoLED, LOW);
      digitalWrite(threeLED, LOW);
      digitalWrite(fourLED, LOW);
      digitalWrite(fiveLED, LOW);
      digitalWrite(sixLED, LOW);
      digitalWrite(sevenLED, LOW);
      digitalWrite(eightLED, LOW);
      digitalWrite(nineLED, LOW);
      digitalWrite(tenLED, LOW);
      old = state;
      break;

    case 2:
      digitalWrite(LED, HIGH);
      digitalWrite(twoLED, HIGH);
      digitalWrite(threeLED, LOW);
      digitalWrite(fourLED, LOW);
      digitalWrite(fiveLED, LOW);
      digitalWrite(sixLED, LOW);
      digitalWrite(sevenLED, LOW);
      digitalWrite(eightLED, LOW);
      digitalWrite(nineLED, LOW);
      digitalWrite(tenLED, LOW);
      old = state;
      break;

    case 3:
      digitalWrite(LED, HIGH);
      digitalWrite(twoLED, HIGH);
      digitalWrite(threeLED, HIGH);
      digitalWrite(fourLED, LOW);
      digitalWrite(fiveLED, LOW);
      digitalWrite(sixLED, LOW);
      digitalWrite(sevenLED, LOW);
      digitalWrite(eightLED, LOW);
      digitalWrite(nineLED, LOW);
      digitalWrite(tenLED, LOW);
      old = state;
      break;

    case 4:
      digitalWrite(LED, HIGH);
      digitalWrite(twoLED, HIGH);
      digitalWrite(threeLED, HIGH);
      digitalWrite(fourLED, HIGH);
      digitalWrite(fiveLED, LOW);
      digitalWrite(sixLED, LOW);
      digitalWrite(sevenLED, LOW);
      digitalWrite(eightLED, LOW);
      digitalWrite(nineLED, LOW);
      digitalWrite(tenLED, LOW);
      old = state;
      break;

    case 5:
      digitalWrite(LED, HIGH);
      digitalWrite(twoLED, HIGH);
      digitalWrite(threeLED, HIGH);
      digitalWrite(fourLED, HIGH);
      digitalWrite(fiveLED, HIGH);
      digitalWrite(sixLED, LOW);
      digitalWrite(sevenLED, LOW);
      digitalWrite(eightLED, LOW);
      digitalWrite(nineLED, LOW);
      digitalWrite(tenLED, LOW);
      old = state;
      break;

    case 6:
      digitalWrite(LED, HIGH);
      digitalWrite(twoLED, HIGH);
      digitalWrite(threeLED, HIGH);
      digitalWrite(fourLED, HIGH);
      digitalWrite(fiveLED, HIGH);
      digitalWrite(sixLED, HIGH);
      digitalWrite(sevenLED, LOW);
      digitalWrite(eightLED, LOW);
      digitalWrite(nineLED, LOW);
      digitalWrite(tenLED, LOW);
      old = state;
      break;

    case 7:
      digitalWrite(LED, HIGH);
      digitalWrite(twoLED, HIGH);
      digitalWrite(threeLED, HIGH);
      digitalWrite(fourLED, HIGH);
      digitalWrite(fiveLED, HIGH);
      digitalWrite(sixLED, HIGH);
      digitalWrite(sevenLED, HIGH);
      digitalWrite(eightLED, LOW);
      digitalWrite(nineLED, LOW);
      digitalWrite(tenLED, LOW);
      old = state;
      break;

    case 8:
      digitalWrite(LED, HIGH);
      digitalWrite(twoLED, HIGH);
      digitalWrite(threeLED, HIGH);
      digitalWrite(fourLED, HIGH);
      digitalWrite(fiveLED, HIGH);
      digitalWrite(sixLED, HIGH);
      digitalWrite(sevenLED, HIGH);
      digitalWrite(eightLED, HIGH);
      digitalWrite(nineLED, LOW);
      digitalWrite(tenLED, LOW);
      old = state;
      break;

    case 9:
      digitalWrite(LED, HIGH);
      digitalWrite(twoLED, HIGH);
      digitalWrite(threeLED, HIGH);
      digitalWrite(fourLED, HIGH);
      digitalWrite(fiveLED, HIGH);
      digitalWrite(sixLED, HIGH);
      digitalWrite(sevenLED, HIGH);
      digitalWrite(eightLED, HIGH);
      digitalWrite(nineLED, HIGH);
      digitalWrite(tenLED, LOW);
      old = state;
      break;

    case 10:
      digitalWrite(LED, HIGH);
      digitalWrite(twoLED, HIGH);
      digitalWrite(threeLED, HIGH);
      digitalWrite(fourLED, HIGH);
      digitalWrite(fiveLED, HIGH);
      digitalWrite(sixLED, HIGH);
      digitalWrite(sevenLED, HIGH);
      digitalWrite(eightLED, HIGH);
      digitalWrite(nineLED, HIGH);
      digitalWrite(tenLED, HIGH);
      old = 0;
      state = 0;


      tone (11, 261);
      delay(250);

      tone(11, 330);
      delay(250);

      tone(11, 391.99);
      delay(250);

      tone(11, 440);
      delay(250);

      tone(11, 391.995);
      delay(250);

      tone(11, 330);
      delay(250);
      noTone(11);


      break;

    default:
      digitalWrite(LED, LOW);
      digitalWrite(twoLED, LOW);
      digitalWrite(threeLED, LOW);
      digitalWrite(fourLED, LOW);
      digitalWrite(fiveLED, LOW);
      digitalWrite(sixLED, LOW);
      digitalWrite(sevenLED, LOW);
      digitalWrite(eightLED, LOW);
      digitalWrite(nineLED, LOW);
      digitalWrite(tenLED, LOW);

      old = 0;

      break;

  }
}