hallo PicNick,
danke für die erleuterung,

doch wie es aussieht stehe ich auf dem bit
mir will einfach nicht klar werden was
if ( Matrix[index] ^= ( PORTB & maske ) )
macht.

was bringt mir z.b. den die bitweise verundung zwischen PORTB und maske " ( PORTB & maske )"?

bsp.
Taste PortB________ maske______resultat?
1:__ 1110 1100__0000 0001___0000 0000
4:__ 1101 1100__0000 0010___0000 0000
7:__ 1011 1100__0000 0100___0000 0100

2:__ 1110 1010__0000 0001___0000 0000
5:__ 1101 1010__0000 0010___0000 0010


für "Matrix[index] ^= ( PORTB & maske )" kann ich auch
"Matrix[index] = Matrix[index] ^( PORTB & maske )" schreiben, ist das richtig?