int cislo = 0;
void setup() {
Serial.begin(9600);
Serial.println("cislo");
// put your setup code here, to run once:
DDRD &= ~(0b11100000);
PORTD |= 0b11100000;
SREG |= 1<<7;
PCICR |= 1<<PCIE2;
PCMSK2 |= 1<<PCINT23;
PCMSK2 |= 1<<PCINT22;
PCMSK2 |= 1<<PCINT21;
}
void loop() {
// put your main code here, to run repeatedly:
}
ISR(PCINT2_vect)
{
if((PIND&(1<<7)) == 0)
{
cislo--;
Serial.println(cislo);
}
else if((PIND&(1<<6)) == 0)
{
cislo++;
Serial.println(cislo);
}
else if((PIND&(1<<5)) == 0)
{
cislo = 0;
Serial.println(cislo);
}
}