lass doch while hier weg, besser ist eine if Abfrage z.B.
Code:
if (PORTB & (1<<PB2))
   PORTC &=~(1<<PC5);
else
   PORTC |=(1<<PC5);
Gruß Sebastian