Hallo

Besser wäre es so:

p[x]=PINA&(1<<x); // für x von 0 bis 7

Die 1 wird x-mal nach links geschoben. Oder noch knapper:

char p, v=0b01010101;

p=PINA;
for (n=0; n<8; n++){
if((v & (1<<n)) == (p & (1<<n)){

Gruß

mic