#include <LiquidCrystal.h>
LiquidCrystal lcd = LiquidCrystal(13,12,11,10,9,8);

int cislo = 0;

void setup() 
{
  lcd.begin(20,4);

  DDRD &= ~(1<<2);
  PORTD |= 1<<2; 

  DDRD &= ~(1<<3);
  PORTD |= 1<<3;

  EIMSK |= 1<<INT0;    //zapina prerušenie na danom pine
  EIMSK |= 1<<INT1;

  SREG |= 1<<7;      //hlavny istic
  
        
  EICRA |= 1<<ISC01;      //nastavuje falling alebo rising
  EICRA &= ~(1<<ISC00); 


  EICRA |= 1<<ISC11;      
  EICRA &= ~(1<<ISC10); 
}

void loop() 
{
  

}

ISR(INT1_vect)
{
  lcd.setCursor(0,0);
  lcd.print("              ");
  cislo--;
  lcd.setCursor(0,0);
  lcd.print(cislo);
}

ISR(INT0_vect)
{
  lcd.setCursor(0,0);
  lcd.print("                ");
  cislo++;
  lcd.setCursor(0,0);
  lcd.print(cislo);
}