#include <LiquidCrystal.h>
LiquidCrystal lcd(13,12,11,10,9,8);
String pole[] = {"Pondelok", "Utorok", "Streda", "Stvrtok", "Piatok", "Sobota", "Nedela"};
int x = 0;
void setup()
{
lcd.begin(16,2);
SREG |= 1<<7;
DDRD &= ~(1<<2);
PORTD |= 1<<2;
DDRD &= ~(1<<3);
PORTD |= 1<<3;
PCICR |= 1<<PCIE2;
PCMSK2 |= 1<<PCINT18;
PCMSK2 |= 1<<PCINT19;
lcd.print(pole[0]);
}
void loop()
{
}
ISR(PCINT2_vect)
{
if((PIND & (1<<3)) == 0)
{
lcd.clear();
x++;
if(x > 6)
x = 0;
lcd.print(pole[x]);
}
if((PIND & (1<<2)) == 0)
{
lcd.clear();
x--;
if(x < 0)
x = 6;
lcd.print(pole[x]);
}
}