b.0 =1 .......................
Hallo Community!!
Hab mal ne Frage bezüglich einer Portabfrage.
Ich möchte auf meiner Platine eine Hardwareadresse abfragen und jetzt stellt sich für mich die Frage von welcher Seite ich dann codieren muss, von Pinb.0 als Bit0 oder als Bit7 bzw. von rechts beginnend oder links beginnend.
Sieht folgensdermaßen aus:
PB0----compiler----Pinb.0
PB1----compiler----Pinb.1
.
.
.
.
.
Portb=&b00000001--------------Ist dann Portb.0=1 oder Portb.7=1 ????????
b.0 =1 .......................
Vor den Erfolg haben die Götter den Schweiß gesetzt
Eigentlich ist es ja einfach:
2^0 = 0b00000001 = 0x01 = (1<<0) = 1 (^0 ist als 1 definiert!)
2^1 = 0b00000010 = 0x02 = (1<<1) = 2
...
2^6 = 0b01000000 = 0x40 = (1<<6) = 64
2^7 = 0b10000000 = 0x80 = (1<<7) = 128
Bild hier
Atmel’s products are not intended, authorized, or warranted for use
as components in applications intended to support or sustain life!
Lesezeichen