#include <LiquidCrystal.h>
LiquidCrystal lcd = LiquidCrystal(13,12,8,9,10,11);
int pocet = 0;
void setup()
{
lcd.begin(16,4);
SREG |= 1<<7;
PCICR |= 1<<PCIE1;
PCMSK1 |= 1<<PCINT11;
DDRD |= 0b00000000;
PORTD |= 0b11111111;
DDRC &= ~(1<<3);
PORTC |= 1<<3;
}
void loop()
{
}
ISR(PCINT1_vect)
{
pocet = 0;
if((PINC & (1<<3)) == 0)
{
for (byte hlas; hlas < 8; hlas++)
{
if(!(PIND & 1<<hlas))
{
pocet++;
}
}
lcd.clear();
if(pocet > 4)
{
lcd.print("Zakon presiel");
}
else
{
lcd.print("Zakon nepresiel");
}
}
}