void setup () {
DDRB |= (1 << 5); //nastavenie vystupu bit5 registra B
DDRB &= ~(1 << 1); //nastavenie vstupu bit1 registra B
PORTB |= (1 << 1); //aktivácia pull up rezistora
}
void loop() {
if((PINB&(1 << 1)) == 0)
{
PORTB |= (1 << 5); //na log. jedna - bit 5
}
else
{
PORTB &= ~(1 << 5); //na log. nulu - bit 5
}
}