Gast
#1067524
Hallo, ich möchte den Zustand von einzelnen PINs am MC auslesen und
einer Variable zuweisen. Folgenden Code habe ich bereits dafür verfasst
aber der funktioniert nicht richtig. Ich finde den Fehler nicht.
"
uint8_t j = 0;
j += PINC & (1<<PC7); //read Port C Input Pins Address --> C7
j <<= 1;
j += PINC & (1<<PC6); //read Port C Input Pins Address --> C6
j <<= 1;
j += PIND & (1<<PD5); //read Port D Input Pins Address --> D5
j <<= 1;
j += PIND & (1<<PD4); //read Port D Input Pins Address --> D4
j <<= 1;
j += PIND & (1<<PD3); //read Port D Input Pins Address --> D3
j <<= 1;
j += PIND & (1<<PD2); //read Port D Input Pins Address --> D2
j <<= 1;
j += PIND & (1<<PD1); //read Port D Input Pins Address --> D1
j <<= 1;
j += PIND & (1<<PD0); //read Port D Input Pins Address --> D0
"
kann mir jemand helfen? Danke im Vorraus.