Hi, schau mal, wie PINB definiert ist, da hat's wahrscheinlich was.
Probier einfach was anderes:
if (PORTB & 0x02) // is im PortB das Bit 2^^1 gesetzt ?
PORTB = 0x00; // ja --> ganzes port auf Null
else PORTB = 0x01; // nö --- > ganzes port auf 1
mfg
Lesezeichen