#include <iom8535v.h>
#include <macros.h.>
void port_init(void)
{
PORTA=0xF1; //na vhod
DDRA=0x00;
PORTB=0x00;
DDRB=0xF0; //na vihod
}
void sdvig(void)
{
int i;
for(i=1;i<4000;i++);
PORTB=PORTB>>1;
}
void main(void)
{
port_init();
PORTB=PINA&0xF0;
while(1)
{
if(PINA&0x01==0x01)
sdvig();
}
}
I2luY2x1ZGUgPGlvbTg1MzV2Lmg+CiNpbmNsdWRlIDxtYWNyb3MuaC4+Cgp2b2lkIHBvcnRfaW5pdCh2b2lkKQp7ClBPUlRBPTB4RjE7IC8vbmEgdmhvZApERFJBPTB4MDA7ClBPUlRCPTB4MDA7IApERFJCPTB4RjA7IC8vbmEgdmlob2QKfQp2b2lkIHNkdmlnKHZvaWQpCnsKaW50IGk7CmZvcihpPTE7aTw0MDAwO2krKyk7ClBPUlRCPVBPUlRCPj4xOwp9Cgp2b2lkIG1haW4odm9pZCkKewpwb3J0X2luaXQoKTsKUE9SVEI9UElOQSYweEYwOwp3aGlsZSgxKQp7CmlmKFBJTkEmMHgwMT09MHgwMSkKc2R2aWcoKTsKfQp9Cg==