#include <avr/io.h>
#include <stdbool.h>

int UpTime = 250;
int DownTime = 1000;
int i;

void setup() {
  // put your setup code here, to run once:
DDRB &= ~(1<<DDB1);
PORTB |= (1<<PB1);
DDRB &= !(1<<DDB2);
PORTB |= (1<<PB2);
DDRB &= !(1<<DDB3);
PORTB |= (1<<PB3);
DDRB &= !(1<<DDB4);
PORTB |= (1<<PB4);
DDRB &= !(1<<DDB5);
PORTB |= (1<<PB5);

DDRB |= (1<<DDB0);
}

void loop() {
  // put your main code here, to run repeatedly:
bool Button1State = PINB & (1<<PB1);
bool Button2State = PINB & (1<<PB2);
bool Button3State = PINB & (1<<PB3);
bool Button4State = PINB & (1<<PB4);
bool Button5State = PINB & (1<<PB5);

if (Button1State) {
  PORTB |= (1<<PB0);
  delay (UpTime);
  PORTB &= ~(1<<PB0);
  delay (UpTime);
}
else if (Button2State) {
  for (i=1; i<=2; i++) {
    PORTB |= (1<<PB0);
    delay (UpTime);
    PORTB &= ~(1<<PB0);
    delay (UpTime);
  }}
   else if (Button3State) {
    for (i=1; i<=3; i++) {
      PORTB |= (1<<PB0);
      delay (UpTime);
      PORTB &= ~(1<<PB0);
      delay (UpTime);
    }}
     else if (Button4State) {
      for (i=1; i<=4; i++) {
        PORTB |= (1<<PB0);
        delay (UpTime);
        PORTB &= ~(1<<PB0);
        delay (UpTime);
      }}
       else if (Button5State) {
        for (i=1; i<=5; i++) {
          PORTB |= (1<<PB0);
          delay (UpTime);
          PORTB &= ~(1<<PB0);
          delay (UpTime);
  }}


if (Button1State) {
  delay(DownTime);
  }   else if (Button2State) {
        delay(DownTime);
        } else if (Button3State) {
           delay(DownTime);
           } else if (Button4State) {
              delay(DownTime);
              } else if (Button5State) {
                 delay(DownTime);
              }


  PORTB &= ~(1<<PB0);
}
ATTINY8520PU