I have another bit assigning problem with C.
I have a variable called Temp.I need to seperate its 8 bits into different PORT bits.
Is my method ok?
I have a variable called Temp.I need to seperate its 8 bits into different PORT bits.
Code:
PORTB.B0 = Temp & 0b00000001;
PORTB.B2 = Temp & 0b00000010;
PORTC.B5 = Temp & 0b00000100;
PORTA.B6 = Temp & 0b00001000;
Is my method ok?