How do I separate the high and low nybbles in a 8 bit binary number?
How do I separate the high and low nybbles in a 8 bit binary number?
For the low one, you just need to and it
with 0x0f. For the high one you just need to
and it with 0xf0 and then shift it to the right by 4.
FYI, the code for what Nick said is:
lowNybb = byte & 0x0F;
highNibb = (byte & 0xF0) >> 4;