while(1) { for(i=0;i<4;i++ {while (PINB.5==0); touche[i]=(PIND & 0xf0)>>4; code=code+(touche[i]*pow(10,3-i)); } if (code==1234) ... }